[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090817115341.GA13895@elte.hu>
Date: Mon, 17 Aug 2009 13:53:41 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>,
linux-kernel@...r.kernel.org, mingo@...hat.com, hpa@...or.com,
tglx@...utronix.de, Yinghai Lu <yinghai@...nel.org>,
Huang Ying <ying.huang@...el.com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
linux-tip-commits@...r.kernel.org
Subject: Re: [PATCH] x86, mce: Don't initialize MCEs on unknown CPUs
* Andi Kleen <ak@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists