LKML Archive on
help / color / mirror / Atom feed
From: Vivek Goyal <>
To: Keith Owens <>
Cc: "Eric W. Biederman" <>,
	Takenori Nagano <>,, Bernhard Walle <>,,,
	Andrew Morton <>
Subject: Re: [patch] add kdump_after_notifier
Date: Sun, 5 Aug 2007 16:37:46 +0530	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Aug 03, 2007 at 02:05:47PM +1000, Keith Owens wrote:

> >Some thoughts on possible solutions for this problem.
> >
> >- Stop exporting panic_notifier_list list to modules. Audit the in kernel
> >  users of panic_notifier_list. Let crash_kexec() run once all other users
> >  of panic_notifier_list have been executed. This has fall side of breaking
> >  down external modules using panic_notifier_list and at the same time
> >  there is no gurantee that audited code will not run into the issues.
> >
> >- Continue with existing policy. If kdump is configured, panic_notifier_list
> >  notifications will not be invoked. Any post panic action should be executed
> >  in second kernel. There might be 1-2 odd cases like in kernel debugger
> >  which still needs to be invoked in first kernel. These users should
> >  explicitly put hooks in panic() routine and refrain from using
> >  panic_notifier list.
> >
> >  One thing to keep in mind, doing things in second kernel might not be easy
> >  as we have lost all the config data of the first kernel. For example,
> >  if one wants to send a kernel crash event over network to a system
> >  management software, he might have to pack in lot of software in 
> >  second kernel's initrd.
> >
> >- Let the user decide if he wants to run panic_notifier_list after the
> >  crash or not with the help of a /proc option as suggested by the
> >  Takenori's patch. Fall side is, on what basis an enterprise user will
> >  take a decision whether he wants to run the notifiers or not. My gut
> >  feeling is that distro will end up setting this parameter as 1 by default,
> >  which would mean first run panic notifiers and then run crash_kexec().
> >
> >- Make crash_kexec() a user of panic_notifier_list and let it run after all
> >  the callback handlers have run. This will invariably reduce the reliability
> >  of kdump.  
> >
> >Personally I believe that second solution should bring us best of both
> >the worlds. Making sure post panic actions can be done more reliably at
> >the same time making sure reliability of kdump is not compromised.
> >
> >Keith, do you see a value in second solution and would there be any
> >reason why kdb hook can not be explicitly placed in panic(). There will
> >not be many users like kdb. Rest of the users should end up performing
> >post panic actions in second kernel. 
> >
> >Solutoin 3, can prove to be a stop gap solution but I think this will
> >make situation confusing for customers at the same time everybody will
> >try to take short route of performing post panic operations in first kernel.
> >
> >Thanks
> >Vivek
> Do not concentrate on kdb alone.  The problem above applies to all the
> RAS tools, not just kdb.
> My stance is that _all_ the RAS tools (kdb, kgdb, nlkd, netdump, lkcd,
> crash, kdump etc.) should be using a common interface that safely puts
> the entire system in a stopped state and saves the state of each cpu.
> Then each tool can do what it likes, instead of every RAS tool doing
> its own thing and they all conflict with each other, which is why this
> thread started.

Hi Keith,

Few thoughts. So there are two things there.

- Create a common infrastructure which can be used by various RAS
  tools and common functionality is not duplicated. For ex. functionality
  for stopping cpus, saving register states etc.

- Create a infrastructure so that user can enforce the policy regarding
  in what order various RAS tools should run.

Last time patches did more of first thing. It had put lots of code
and the only user of that code was kexec/kdump. Sometime motivation level
is low regarding why to put so much of infrastructure code in if there
are no users and it can potentially bring down the reliability of kdump.

> It is not the kernel's job to decide which RAS tool runs first, second
> etc., it is the user's decision to set that policy.  Different sites
> will want different orders, some will say "go straight to kdump", other
> sites will want to invoke a debugger first.  Sites must be able to
> define that policy, but we hard code the policy into the kernel.
> I proposed and wrote most of this common interface against 2.6.19-rc5.
> See, look for
> crash_stop.  The crash_stop interface stops all the cpus, saves the
> system state in a common format then runs an ordered list of RAS tools.

Agreed. It would be great if during next posting one can also post the
patches for exporting the policy decision to user space.

Having said that, who do you think are potential RAS tools among
which a user has to make a choice while determining the order. I
can think of only two. Crash dump and debugger. 

> The order that the RAS tools are run depends on the priority value that
> each tool passes to register_die_notifier.  Currently each RAS tool
> hard codes its priority but it is trivial to change the tools to make
> that priority a parameter, passing the policy decision back to the
> user, not the kernel.

I have got some concerns here and that's what precisely the core
point where this mail thread started. What does one do with die
notifier and panic notifer list? Should RAS tools like debugger
and crash dumpers register on this list and wait for their turn
to execute?

There are many other in kernel users who register on die or panic
notifier list. Like heartbeat, IPMI,..... Given the fact that
these symbols are exported, there will be proprietary users also
for whom we never get a chance to see their code.

Can one really trust all these users and let them run before
any RAS tool gets the control? After the kernel crash, there
is no gurantee regarding how many of these actions can be
successfully completed. Probably in case of in kernel debuggers
one can afford to do that but I think in case of kdump one
should not as all these actions can be reliably performed
in second kernel.

To sum up, couple of options come to mind.

- Register all the RAS tools on die notifier and panic
  notifier lists with fairly high priority. Export list
  of RAS tools to user space and allow users to decide the
  order of execution and priority of RAS tools.

- Create a separate RAS tool notifier list (ras_tool_notifer_list).
  All the RAS tools register on this list. This list gets priority
  over die or panic notifier list. User decides the oder of execution
  of RAS tools. 

  Here assumption is that above list will not be exported to modules.
  All the RAS tools will be in kernel and they always get a priority
  to inspect an event.

What do others think?


  parent reply	other threads:[~2007-08-05 11:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 12:15 Takenori Nagano
2007-07-26 14:07 ` Bernhard Walle
2007-07-26 15:32   ` Vivek Goyal
2007-07-26 15:34     ` Bernhard Walle
2007-07-26 15:44       ` Vivek Goyal
2007-07-26 15:47         ` Bernhard Walle
2007-07-26 15:54           ` Vivek Goyal
2007-07-26 16:14             ` Bernhard Walle
2007-07-26 16:21               ` Bernhard Walle
2007-07-26 23:28             ` Takenori Nagano
2007-07-30  9:16               ` Vivek Goyal
2007-07-30 13:42                 ` Eric W. Biederman
2007-07-31  5:55                   ` Takenori Nagano
2007-07-31  6:53                     ` Eric W. Biederman
2007-08-01  9:26                       ` Takenori Nagano
2007-08-01 10:00                         ` Eric W. Biederman
2007-08-02  8:11                           ` Takenori Nagano
2007-08-02 11:28                           ` Vivek Goyal
2007-08-03  4:05                             ` Keith Owens
2007-08-03  6:25                               ` Andrew Morton
2007-08-03  6:34                                 ` Keith Owens
2007-08-03  7:37                                   ` Andrew Morton
2007-08-03  7:10                                 ` Eric W. Biederman
2007-08-05 11:07                               ` Vivek Goyal [this message]
2007-08-14  8:34                                 ` Takenori Nagano
2007-08-14  8:37                                   ` Bernhard Walle
2007-08-14  8:48                                     ` Takenori Nagano
2007-08-14  8:53                                       ` Bernhard Walle
2007-08-14 13:24                                     ` Vivek Goyal
2007-08-16  9:26                                       ` Takenori Nagano
2007-08-16  9:45                                         ` Bernhard Walle
2007-08-17 10:56                                         ` Vivek Goyal
2007-08-21  7:45                                           ` Takenori Nagano
2007-08-23  3:52                                             ` Vivek Goyal
2007-08-21 13:18                                           ` Jay Lan
2007-08-21 13:21                                             ` Bernhard Walle
2007-08-23  3:56                                             ` Vivek Goyal
2007-08-23 17:34                                               ` Jay Lan

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [patch] add kdump_after_notifier' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).