Re: [PATCH] X86: reboot-notify additions

From: Ingo Molnar
Date: Fri Jun 20 2008 - 07:45:58 EST



* Cliff Wickman <cpw@xxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/