From: "Andreas Herrmann" <andreas.herrmann3@amd.com>
To: "Andi Kleen" <ak@suse.de>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
"Akinobu Mita" <akinobu.mita@gmail.com>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH] x86: fix cpu-hotplug regression
Date: Wed, 7 Nov 2007 14:18:36 +0100 [thread overview]
Message-ID: <20071107131836.GB31607@alberich.amd.com> (raw)
In-Reply-To: <200711070335.44416.ak@suse.de>
On Wed, Nov 07, 2007 at 03:35:43AM +0100, Andi Kleen wrote:
> On Wednesday 07 November 2007 02:12, Andreas Herrmann wrote:
>
> > In cases where not all CPUs are brought up during
> > boot (e.g. using maxcpus and additional_cpus parameters)
> > mce_cpu_callback now returns NOTFIY_BAD because
> > for such CPUs cpu_data is not completely filled when
> > the notifier is called. Thus mce_create_device fails right
> > at its beginning:
> >
> > if (!mce_available(&cpu_data[cpu]))
> > return -EIO;
> >
> > As a quick fix I suggest to check boot_cpu_data for MCE.
>
> I guess it would be better to just move the device creation
> to after the CPU has booted. AKA call mce_create_dev() on CPU_ONLINE
> instead.
Yes, and this was the old behaviour. The mentioned patch changed it -
("do mce_create_device in CPU_UP_PREPARE instead of CPU_ONLINE").
Thinking twice about the problem it seems obvious that this part
of the patch should just be reverted.
Attached is a new fix (diff against 2.6.24-rc2).
Regards,
Andreas
--
[PATCH] x86: fix cpu hotplug regression (don't call mce_create_device on CPU_UP_PREPARE)
Fix regression introduced with d435d862baca3e25e5eec236762a43251b1e7ffc
("cpu hotplug: mce: fix cpu hotplug error handling").
For CPUs not brought up during boot (using maxcpus and additional_cpus
parameters) we don't know whether mce is supported or not at "CPU_UP_PREPARE"-time.
Thus mce_cpu_callback should be called after the CPU is online.
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
arch/x86/kernel/cpu/mcheck/mce_64.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c
index b9f802e..8e83070 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -855,12 +855,10 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
int err = 0;
switch (action) {
- case CPU_UP_PREPARE:
- case CPU_UP_PREPARE_FROZEN:
+ case CPU_ONLINE:
+ case CPU_ONLINE_FROZEN:
err = mce_create_device(cpu);
break;
- case CPU_UP_CANCELED:
- case CPU_UP_CANCELED_FROZEN:
case CPU_DEAD:
case CPU_DEAD_FROZEN:
mce_remove_device(cpu);
--
1.5.3.4
next prev parent reply other threads:[~2007-11-07 13:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-07 1:12 [PATCH] x86: fix cpu-hotplug regression Andreas Herrmann
2007-11-07 2:35 ` Andi Kleen
2007-11-07 13:18 ` Andreas Herrmann [this message]
2007-11-07 14:15 ` Akinobu Mita
2007-11-09 20:16 ` Andrew Morton
2007-11-12 10:07 ` Andreas Herrmann
2007-11-12 17:38 ` [PATCH] x86: don't call mce_create_device on CPU_UP_PREPARE Andreas Herrmann
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=20071107131836.GB31607@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--cc=ak@suse.de \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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