Commit 71da3667 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] sched: hotplug add a CPU_DOWN_FAILED notifier

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: default avatarNick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0298ac9c
...@@ -68,7 +68,8 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi ...@@ -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_PREPARE 0x0003 /* CPU (unsigned)v coming up */
#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT 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_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 /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */ #endif /* _LINUX_NOTIFIER_H */
...@@ -141,6 +141,11 @@ int cpu_down(unsigned int cpu) ...@@ -141,6 +141,11 @@ int cpu_down(unsigned int cpu)
p = __stop_machine_run(take_cpu_down, NULL, cpu); p = __stop_machine_run(take_cpu_down, NULL, cpu);
if (IS_ERR(p)) { 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); err = PTR_ERR(p);
goto out_allowed; goto out_allowed;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment