]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched: hotplug add a CPU_DOWN_FAILED notifier
authorNick Piggin <nickpiggin@yahoo.com.au>
Mon, 18 Oct 2004 16:10:25 +0000 (09:10 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Oct 2004 16:10:25 +0000 (09:10 -0700)
Introduce CPU_DOWN_FAILED notifier, so we can cope with a failure after a
CPU_DOWN_PREPARE notice.

This fixes 3/8 "add CPU_DOWN_PREPARE notifier" to be useful

Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/notifier.h
kernel/cpu.c

index 00c996f0885123138ab89defd263b41be3583d6e..9303a003e9ab85147dcafc82c6d74fc27d468bf5 100644 (file)
@@ -68,7 +68,8 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi
 #define CPU_UP_PREPARE         0x0003 /* CPU (unsigned)v coming up */
 #define CPU_UP_CANCELED                0x0004 /* CPU (unsigned)v NOT coming up */
 #define CPU_DOWN_PREPARE       0x0005 /* CPU (unsigned)v going down */
-#define CPU_DEAD               0x0006 /* CPU (unsigned)v dead */
+#define CPU_DOWN_FAILED                0x0006 /* CPU (unsigned)v NOT going down */
+#define CPU_DEAD               0x0007 /* CPU (unsigned)v dead */
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_NOTIFIER_H */
index 84e78a6560bc0854f051c3cbd7c621a666648bab..719ba42ff5ee275d029cc1f0567f4c298db179cd 100644 (file)
@@ -141,6 +141,11 @@ int cpu_down(unsigned int cpu)
 
        p = __stop_machine_run(take_cpu_down, NULL, cpu);
        if (IS_ERR(p)) {
+               /* CPU didn't die: tell everyone.  Can't complain. */
+               if (notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
+                               (void *)(long)cpu) == NOTIFY_BAD)
+                       BUG();
+
                err = PTR_ERR(p);
                goto out_allowed;
        }