Re: [PATCH] X86: reboot-notify additions
From: Andi Kleen
Date: Wed Jun 18 2008 - 23:03:31 EST
Cliff Wickman <cpw@xxxxxxx> writes:
> From: Cliff Wickman <cpw@xxxxxxx>
>
> X86 reboot-notify additions.
Doesn't seem x86 specific to me.
> @@ -1068,6 +1071,8 @@ void crash_kexec(struct pt_regs *regs)
> if (!locked) {
> if (kexec_crash_image) {
> struct pt_regs fixed_regs;
> + blocking_notifier_call_chain(&reboot_notifier_list,
> + SYS_INSANE, NULL);
But you don't really want to block during a crash, do you?
> crash_setup_regs(&fixed_regs, regs);
> crash_save_vmcoreinfo();
> machine_crash_shutdown(&fixed_regs);
> Index: linux/kernel/sys.c
> ===================================================================
> --- linux.orig/kernel/sys.c
> +++ linux/kernel/sys.c
> @@ -270,6 +270,7 @@ out_unlock:
> */
> void emergency_restart(void)
> {
> + blocking_notifier_call_chain(&reboot_notifier_list, SYS_INSANE, NULL);
Here neither.
In fact taking any locks here is dangerous because if you crash holding
such a lock the system will deadlock on panic.
-Andi
--
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/