mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Akiyama, Nobuyuki" <akiyama.nobuyuk@jp.fujitsu.com>
To: vgoyal@in.ibm.com
Cc: linux-kernel@vger.kernel.org, fastboot@lists.osdl.org
Subject: Re: [Fastboot] [RFC][PATCH] Add missing notifier before crashing
Date: Thu, 1 Jun 2006 21:37:30 +0900	[thread overview]
Message-ID: <20060601213730.dc9f1ec4.akiyama.nobuyuk@jp.fujitsu.com> (raw)
In-Reply-To: <20060531154322.GA8475@in.ibm.com>

On Wed, 31 May 2006 11:43:22 -0400
Vivek Goyal <vgoyal@in.ibm.com> wrote:

> On Wed, May 31, 2006 at 06:20:45PM +0900, Akiyama, Nobuyuki wrote:
> > Hello Vivek-san,
> > 
> > On Tue, 30 May 2006 10:56:58 -0400
> > Vivek Goyal <vgoyal@in.ibm.com> wrote:
> > 
> > > On Tue, May 30, 2006 at 06:33:59PM +0900, Akiyama, Nobuyuki wrote:
> > > > Hello,
> > > > 
> > > > The panic notifier(i.e. panic_notifier_list) does not be called
> > > > if kdump is activated because crash_kexec() does not return.
> > > > And there is nothing to notify of crash before crashing by SysRq-c.
> > > > 
> > > > Although notify_die() exists, the function depends on architecture.
> > > > If notify_die() is added in panic and SysRq respectively like existing
> > > > implementation, the code will be ugly.
> > > > I think that adding a generic hook in crash_kexec() is better to simplify
> > > > the code. The panic_notifier_list-user will have nothing to do.
> > > > If you want to catch SysRq, use the crash_notifier_list.
> > > > 
> > > 
> > > What's the use of introducing crash_notifier_list? Who is going to use
> > > it for what purpose?
> > > 
> > > Probably we don't want to create any such infrastructure because carries
> > > the risk of hanging in between and reducing the reliability of dump 
> > > operation.
> > 
> > I really understand what you concern about.
> > But a certain program indeed needs some processing before
> > crashing even if panic occurs.
> > Now standard kernel includes some panic_notifier_list-user,
> > these are the familiar examples.
> 
> I see the panic_notifier_list but I am afraid that we can not afford
> to send the crash/panic notifications if system admin has chosen to load
> the kdump kernel and has decided to take a dump in case of a crash event.
> This might very seriously compromise the reliability of kdump. IIRC, we
> recently saw an issue with powerpc where we did not even start booting into
> the second kernel as system lost way somewhere while handling notifiers.
> 
> So far on a panic event kernel only used to display the panic string
> and halt the system but now it tries to do much more. That is boot
> into the second kernel and caputure the dump. Of course, one can argue
> that I want to implement a different policy in case of system crash. In
> that case probably we should not load the kdump kernel at all.
> 
> panic_notifier_list helps in this regard that multiple subsystem can
> register their own policy and policy will be excuted in the registered
> priority order. Given the nature of kdump, I feel it is kind of 
> mutually exclusive and can not co-exist with other policies. Otherwise, we 
> will end up calling all other policies first and trigger booting into
> the second kernel last. This is equivalent to giving higher priority to
> all other policies and least priority to kdump.

I think crash_kexec() is the best point to simplify notifier-call.
If the notifier is bad implementation, kdump reliability may
be decreased. But the risk depends on notifier quality.
I think it is not bad that we have the opportunity to call notifier.
As you say, current panic_notifier_list may not be suitable
because that was implemented before kdump merged.

You accept if panic_notifier_list is dropped from crash_notify()
like below(not complete patch)? If one want to catch panic
and SysRq event before crashing, crash_notifier_list can be used.

------ 
-void crash_kexec(struct pt_regs *regs)
+static void notify_crash(int type, void *v)
+{
+	raw_notifier_call_chain(&crash_notifier_list, type, v);
+}
+
+void crash_kexec(int type, struct pt_regs *regs, void *v)
 {
 	struct kimage *image;
 	int locked;
@@ -1061,6 +1072,7 @@ void crash_kexec(struct pt_regs *regs)
 			struct pt_regs fixed_regs;
 			crash_setup_regs(&fixed_regs, regs);
 			machine_crash_shutdown(&fixed_regs);
+			notify_crash(type, v);
 			machine_kexec(image);
 		}
 		xchg(&kexec_lock, 0);
------ 

> > 
> > As other example, a cluster support software needs to clean up
> > current environment and to take over immediately.  > To do so, the cluster software immediately and surely want to
> > know the current node dies.
> > Some mission critical systems demand to start taking over
> > within a few milli-second after the system dies.
> > 
> 
> I am no failover expert, but a quick thought suggests me that doing
> anything after the panic is not reliable. So should't all failover
> mechanisms depend on auto detecting that failure has occurred instead
> of failing system informing that I am about to fail so you better take
> over. Something like syncying two systems with a hearbeat message kind
> of thing and if main node fails, it will stop generating hearbeat
> messages and spare node will take over.

You are right, but that mechanism waists very long time.
The probability that fail in informing spare node of death is lower
than you think.

Regards,

Akiyama, Nobuyuki


  parent reply	other threads:[~2006-06-01 12:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30  9:33 Akiyama, Nobuyuki
2006-05-30 14:56 ` [Fastboot] " Vivek Goyal
2006-05-31  9:20   ` Akiyama, Nobuyuki
2006-05-31 15:43     ` Vivek Goyal
2006-06-01 10:50       ` Preben Traerup
2006-06-01 12:37       ` Akiyama, Nobuyuki [this message]
2006-06-01 15:16         ` Vivek Goyal
2006-06-02  5:13           ` Akiyama, Nobuyuki
2006-06-02 10:08             ` Preben Traerup
2006-06-02 11:52               ` Eric W. Biederman
2006-06-02 13:20                 ` Preben Traerup
2006-06-02 15:20                   ` Eric W. Biederman
2006-06-02 15:37                     ` Vivek Goyal
2006-06-02 16:39                       ` Eric W. Biederman
2006-06-06  9:36                     ` Preben Traerup
2006-06-06 11:08                       ` Akiyama, Nobuyuki
2006-06-06 13:59                         ` Akiyama, Nobuyuki
2006-06-02 14:53                 ` Vivek Goyal
2006-06-05 11:46                 ` Akiyama, Nobuyuki
2006-06-02 14:56               ` Vivek Goyal
2006-06-06 10:12                 ` Preben Traerup

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=20060601213730.dc9f1ec4.akiyama.nobuyuk@jp.fujitsu.com \
    --to=akiyama.nobuyuk@jp.fujitsu.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@in.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®