lkml.org 
[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, mce: Don't initialize MCEs on unknown CPUs

* Andi Kleen <ak@linux.intel.com> wrote:

> Ingo Molnar wrote:
>
>>
>> btw., i found the bug - it's due to:
>>
>> # CONFIG_CPU_SUP_INTEL is not set
>
> Ah, thanks for debugging. Very tricky and nasty. Perhaps these options are more trouble
> than what they save in code.
>
>> static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
>> @@ -1342,11 +1352,10 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
>> if (!mce_available(c))
>> return;
>> - if (mce_cap_init() < 0) {
>> + if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) {
>> mce_disabled = 1;
>> return;
>> }
>> - mce_cpu_quirks(c);
>
> I'm very pedantic here and it's more a theoretical problem, but
> mce_cap_init() allocates memory which you leak and this could
> rerun on each CPU hotplug. So if you have a unknown CPU and do a
> lot of CPU hotadds in a loop then you would eventually fill all
> memory. Better kfree() the bank arrays.

Not really, we dont re-run mce_cap_init() if MCE is disabled so
there's no memory leak that would fill all memory.

Ingo


\
 
 \ /
  Last update: 2009-08-17 13:57    [W:0.127 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site