From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [2/2] Don't complain about disabled irqs when the system has paniced
Date: Tue, 02 Sep 2008 16:28:03 +0200 [thread overview]
Message-ID: <1220365683.8609.58.camel@twins> (raw)
In-Reply-To: <20080902134923.9A7EF3E6A01@basil.firstfloor.org>
On Tue, 2008-09-02 at 15:49 +0200, Andi Kleen wrote:
> panic calls smp_send_stop which eventually calls smp_call_function_*.
> smp_call_function warns about disabled interrupts. But it's legal
> to call panic in this case. When this happens panic() prints
> several ugly backtraces. So don't check for disabled interrupts
> in panic state.
While it might be legal for panic to be called from such contexts, I
understand those warnings are there to warn of deadlocks.
So with the below patch you allow panic to deadlock if I understand
things correctly.
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> Index: linux/kernel/smp.c
> ===================================================================
> --- linux.orig/kernel/smp.c
> +++ linux/kernel/smp.c
> @@ -216,7 +216,7 @@ int smp_call_function_single(int cpu, vo
> int err = 0;
>
> /* Can deadlock when called with interrupts disabled */
> - WARN_ON(irqs_disabled());
> + WARN_ON(system_state < SYSTEM_PANIC && irqs_disabled());
>
> if (cpu == me) {
> local_irq_save(flags);
> @@ -260,7 +260,8 @@ EXPORT_SYMBOL(smp_call_function_single);
> void __smp_call_function_single(int cpu, struct call_single_data *data)
> {
> /* Can deadlock when called with interrupts disabled */
> - WARN_ON((data->flags & CSD_FLAG_WAIT) && irqs_disabled());
> + WARN_ON(system_state < SYSTEM_PANIC &&
> + (data->flags & CSD_FLAG_WAIT) && irqs_disabled());
>
> generic_exec_single(cpu, data);
> }
> @@ -329,7 +330,7 @@ int smp_call_function_mask(cpumask_t mas
> int slowpath = 0;
>
> /* Can deadlock when called with interrupts disabled */
> - WARN_ON(irqs_disabled());
> + WARN_ON(system_state < SYSTEM_PANIC && irqs_disabled());
>
> cpu = smp_processor_id();
> allbutself = cpu_online_map;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2008-09-02 14:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 13:49 [PATCH] [0/2] Fix panic regression in 2.6.27 Andi Kleen
2008-09-02 13:49 ` [PATCH] [1/2] Add a SYSTEM_PANIC state Andi Kleen
2008-09-03 19:04 ` Andrew Morton
2008-09-03 19:16 ` Andi Kleen
2008-09-03 19:32 ` Andrew Morton
2008-09-03 19:44 ` Andi Kleen
2008-09-02 13:49 ` [PATCH] [2/2] Don't complain about disabled irqs when the system has paniced Andi Kleen
2008-09-02 14:28 ` Peter Zijlstra [this message]
2008-09-02 14:40 ` Andi Kleen
2008-09-02 14:45 ` Peter Zijlstra
2008-09-02 15:00 ` Andi Kleen
2008-09-03 6:02 ` Nick Piggin
2008-09-03 6:59 ` Andi Kleen
2008-09-03 9:37 ` Nick Piggin
2008-09-03 9:48 ` Andi Kleen
2008-09-03 10:17 ` Nick Piggin
2008-09-03 10:26 ` Jens Axboe
2008-09-12 19:50 ` Pavel Machek
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=1220365683.8609.58.camel@twins \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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