From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Don Zickus <dzickus@redhat.com>
Cc: Jan Kiszka <jan.kiszka@web.de>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Eric Paris <eparis@redhat.com>,
Randy Dunlap <randy.dunlap@oracle.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: BUG: using smp_processor_id() in preemptible arch_trigger_all_cpu_backtrace_handler
Date: Mon, 1 Nov 2010 18:51:10 +0300 [thread overview]
Message-ID: <20101101155110.GC5985@lenovo> (raw)
In-Reply-To: <20101101154536.GT4823@redhat.com>
On Mon, Nov 01, 2010 at 11:45:36AM -0400, Don Zickus wrote:
...
> Heh. Yeah when I migrated the code, I completely forgot the notifier
> chain could be called from a preemptible context (ie not NMI).
>
> This patch should fix it and I think it is the correct fix. Let me know
> how it works out.
>
> Cheers,
> Don
>
> diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c
> index c7c9ae4..1bdd0b5 100644
> --- a/arch/x86/kernel/apic/hw_nmi.c
> +++ b/arch/x86/kernel/apic/hw_nmi.c
> @@ -63,7 +63,7 @@ arch_trigger_all_cpu_backtrace_handler(struct notifier_block *self,
> {
> struct die_args *args = __args;
> struct pt_regs *regs;
> - int cpu = smp_processor_id();
> + int cpu;
>
> switch (cmd) {
> case DIE_NMI:
> @@ -74,6 +74,7 @@ arch_trigger_all_cpu_backtrace_handler(struct notifier_block *self,
> }
>
> regs = args->regs;
> + cpu = smp_processor_id();
>
> if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
> static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED;
>
yup, this will do the trick for a while. In general I believe we might have
kind of NMI exclusive chain so we wouldn't need the 'case:'s.
Cyrill
next prev parent reply other threads:[~2010-11-01 15:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-01 12:39 BUG: using smp_processor_id() in preemptible arch_trigger_all_cpu_backtrace_handler Jan Kiszka
2010-11-01 15:37 ` Cyrill Gorcunov
2010-11-01 15:45 ` Don Zickus
2010-11-01 15:51 ` Cyrill Gorcunov [this message]
2010-11-05 16:06 ` Frederic Weisbecker
2010-11-05 16:37 ` Cyrill Gorcunov
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=20101101155110.GC5985@lenovo \
--to=gorcunov@gmail.com \
--cc=dzickus@redhat.com \
--cc=eparis@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jan.kiszka@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=randy.dunlap@oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.