mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [1/2] Add a SYSTEM_PANIC state
Date: Wed, 3 Sep 2008 12:04:23 -0700	[thread overview]
Message-ID: <20080903120423.9e00557c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080902134922.9401F3E6A00@basil.firstfloor.org>

On Tue,  2 Sep 2008 15:49:22 +0200 (CEST)
Andi Kleen <andi@firstfloor.org> wrote:

> --- linux.orig/include/linux/kernel.h
> +++ linux/include/linux/kernel.h
> @@ -248,6 +248,7 @@ extern enum system_states {
>  	SYSTEM_POWER_OFF,
>  	SYSTEM_RESTART,
>  	SYSTEM_SUSPEND_DISK,
> +	SYSTEM_PANIC,
>  } system_state;

system_state is such a crock.  I wonder what other random code all over
the place is looking at system_state and will get unexpectedly broken
by other "unrelated" changes such as this..


It's not a heck of a lot nicer, but we could do this:

--- a/kernel/panic.c~a
+++ a/kernel/panic.c
@@ -80,7 +80,6 @@ NORET_TYPE void panic(const char * fmt, 
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 	printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
-	bust_spinlocks(0);
 
 	/*
 	 * If we have crashed and we have a crash kernel loaded let it handle
@@ -97,6 +96,7 @@ NORET_TYPE void panic(const char * fmt, 
 	 */
 	smp_send_stop();
 #endif
+	bust_spinlocks(0);
 
 	atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
 
_

then test oops_in_progress down in the IPI code.  This has the
advantage of not introducing any additional global states and is a bit
more logical, I think.  Need to check whether crash_kexec() would be
affected by the above change.


Bear in mind that the oops-handling code can call panic(), if
panic_on_oops==1.  I can't think of any adverse or special consequences
of this, but it needs to be thought about.


  reply	other threads:[~2008-09-03 19:05 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 [this message]
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
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=20080903120423.9e00557c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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