diff options
| author | Nick Piggin <nickpiggin@yahoo.com.au> | 2004-10-18 09:08:34 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-18 09:08:34 -0700 |
| commit | d13d28de21d913aacd3c91e76e307fa2eb7835d8 (patch) | |
| tree | cd2839bf45795524088b38888039a1f67ce37b54 /kernel | |
| parent | e4dbd222c7ae76cfd0cd68196fa9574322c3c3bf (diff) | |
[PATCH] sched: add CPU_DOWN_PREPARE notifier
Add a CPU_DOWN_PREPARE hotplug CPU notifier. This is needed so we can dettach
all sched-domains before a CPU goes down, thus we can build domains from
online cpumasks, and not have to check for the possibility of a CPU coming up
or going down.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 64b8ed3cc8ea..84e78a6560bc 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -124,6 +124,15 @@ int cpu_down(unsigned int cpu) goto out; } + err = notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE, + (void *)(long)cpu); + if (err == NOTIFY_BAD) { + printk("%s: attempt to take down CPU %u failed\n", + __FUNCTION__, cpu); + err = -EINVAL; + goto out; + } + /* Ensure that we are not runnable on dying cpu */ old_allowed = current->cpus_allowed; tmp = CPU_MASK_ALL; |
