lkml.org 
[lkml]   [2008]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] X86: reboot-notify additions

* Cliff Wickman <cpw@sgi.com> wrote:

> > > +#define SYS_INSANE 0x0004 /* Notify of system error/panic/oops */
> > > +/* For the SYS_INSANE case, no locks should be taken by the called-back
> > > + * function. The kernel is ready for an immediate reboot.
> > > + */

please use standard comment blocks, something like this:

/*
* Notify of system error/panic/oops
*
* No locks should be taken by the called-back function.
* The kernel is ready for an immediate reboot.
*/
#define SYS_INSANE 0x0004

> > > +++ linux/kernel/kexec.c
> > > @@ -1001,6 +1001,9 @@ asmlinkage long sys_kexec_load(unsigned
> > > if (result)
> > > goto out;
> > > }
> > > +
> > > + blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);

this puts an extra blocking call into a kexec critical path.

> struct pt_regs fixed_regs;
> + struct raw_notifier_head rh;
> + rh.head = reboot_notifier_list.head;
> + raw_notifier_call_chain(&rh, SYS_EMERGENCY, NULL);

that's very nasty. Now callbacks which put themselves on a blocking list
will be called without locking.

> void emergency_restart(void)
> {
> + struct raw_notifier_head rh;
> +
> + rh.head = reboot_notifier_list.head;
> + raw_notifier_call_chain(&rh, SYS_EMERGENCY, NULL);

ditto.

this patch is still far from being acceptable.
Ingo


\
 
 \ /
  Last update: 2008-06-20 13:49    [W:0.073 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site