mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andi Kleen <ak@linux.intel.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
	tglx@linutronix.de, Yinghai Lu <yinghai@kernel.org>,
	Huang Ying <ying.huang@intel.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-tip-commits@vger.kernel.org
Subject: Re: [PATCH] x86, mce: Don't initialize MCEs on unknown CPUs
Date: Mon, 17 Aug 2009 13:53:41 +0200	[thread overview]
Message-ID: <20090817115341.GA13895@elte.hu> (raw)
In-Reply-To: <4A89409B.8020103@linux.intel.com>


* 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

  reply	other threads:[~2009-08-17 11:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-4efc0670baf4b14bc95502e54a83ccf639146125@git.kernel.org>
2009-08-12 11:36 ` [boot crash] Re: [tip:x86/mce3] x86, mce: use 64bit machine check code on 32bit Ingo Molnar
2009-08-17  5:00   ` Hidetoshi Seto
2009-08-17  8:35     ` Ingo Molnar
2009-08-17  9:08       ` Hidetoshi Seto
2009-08-17  9:18         ` Ingo Molnar
2009-08-17  9:20         ` Ingo Molnar
2009-08-17 11:08           ` Andi Kleen
2009-08-17 11:24             ` Ingo Molnar
2009-09-22 15:41             ` Ingo Molnar
2009-09-23 15:22               ` Andi Kleen
2009-09-23 16:18                 ` Ingo Molnar
2009-08-17 10:56         ` Andi Kleen
2009-08-17 11:00           ` Ingo Molnar
2009-08-17 11:29         ` [PATCH] x86, mce: Don't initialize MCEs on unknown CPUs Ingo Molnar
2009-08-17 11:35           ` Andi Kleen
2009-08-17 11:53             ` Ingo Molnar [this message]
2009-08-17 13:28               ` Andi Kleen
2009-08-17 11:25   ` [boot crash] Re: [tip:x86/mce3] x86, mce: use 64bit machine check code on 32bit Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090817115341.GA13895@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=ying.huang@intel.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®