mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Gong <gong.chen@linux.intel.com>
To: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	x86@kernel.org
Subject: Re: cpu offline causes backtrace from cmci_rediscover
Date: Tue, 19 Mar 2013 23:16:47 -0400	[thread overview]
Message-ID: <20130320031647.GA13311@gchen.bj.intel.com> (raw)
In-Reply-To: <20130319224408.GB18152@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2168 bytes --]

On Tue, Mar 19, 2013 at 06:44:08PM -0400, Dave Jones wrote:
> Date:	Tue, 19 Mar 2013 18:44:08 -0400
> From: Dave Jones <davej@redhat.com>
> To: Linux Kernel <linux-kernel@vger.kernel.org>
> Cc: x86@kernel.org
> Subject: cpu offline causes backtrace from cmci_rediscover
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> offlining a CPU in 3.9-rc3 gets me this trace..
> 
> numa_remove_cpu cpu 1 node 0: mask now 0,2-3
> smpboot: CPU 1 is now offline
> BUG: using smp_processor_id() in preemptible [00000000] code: cpu-offline.sh/10591
> caller is cmci_rediscover+0x6a/0xe0
> Pid: 10591, comm: cpu-offline.sh Not tainted 3.9.0-rc3+ #2
> Call Trace:
>  [<ffffffff81333bbd>] debug_smp_processor_id+0xdd/0x100
>  [<ffffffff8101edba>] cmci_rediscover+0x6a/0xe0
>  [<ffffffff815f5b9f>] mce_cpu_callback+0x19d/0x1ae
>  [<ffffffff8160ea66>] notifier_call_chain+0x66/0x150
>  [<ffffffff8107ad7e>] __raw_notifier_call_chain+0xe/0x10
>  [<ffffffff8104c2e3>] cpu_notify+0x23/0x50
>  [<ffffffff8104c31e>] cpu_notify_nofail+0xe/0x20
>  [<ffffffff815ef082>] _cpu_down+0x302/0x350
>  [<ffffffff815ef106>] cpu_down+0x36/0x50
>  [<ffffffff815f1c9d>] store_online+0x8d/0xd0
>  [<ffffffff813edc48>] dev_attr_store+0x18/0x30
>  [<ffffffff81226eeb>] sysfs_write_file+0xdb/0x150
>  [<ffffffff811adfb2>] vfs_write+0xa2/0x170
>  [<ffffffff811ae16c>] sys_write+0x4c/0xa0
>  [<ffffffff81613019>] system_call_fastpath+0x16/0x1b
> 
Try this patch:

diff a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index 402c454..692c91e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -311,10 +311,12 @@ void cmci_rediscover(int dying)
                if (cpu == dying)
                        continue;

-               if (cpu == smp_processor_id()) {
+               if (cpu == get_cpu()) {
+                       put_cpu();
                        cmci_rediscover_work_func(NULL);
                        continue;
-               }
+               } else
+                       put_cpu();

                work_on_cpu(cpu, cmci_rediscover_work_func, NULL);
        }


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-03-20  3:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 22:44 Dave Jones
2013-03-20  3:16 ` Chen Gong [this message]
2013-03-20  5:20   ` Mike Galbraith
2013-03-20 10:01   ` [PATCH] x86/mce: Rework cmci_rediscover() to play well with CPU hotplug Srivatsa S. Bhat
2013-03-20 10:46     ` Borislav Petkov
2013-03-20 23:28     ` Tony Luck
2013-04-02 14:08     ` Srivatsa S. Bhat
2013-04-02 14:17       ` Borislav Petkov
2013-04-02 20:58         ` Luck, Tony

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=20130320031647.GA13311@gchen.bj.intel.com \
    --to=gong.chen@linux.intel.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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

Powered by JetHome