summaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2010-03-15 10:10:23 +0100
committerThomas Gleixner <tglx@linutronix.de>2010-07-20 19:11:47 +0200
commitbb8eef78087fd2f10bcfca68f794640f7d37592c (patch)
tree360806301ba7f98b34178b8e89c958df1d3d535f /include/linux/sched.h
parenta325588ec5c7384514a79f01ddebf274477eaf51 (diff)
downloadlwn-bb8eef78087fd2f10bcfca68f794640f7d37592c.tar.gz
lwn-bb8eef78087fd2f10bcfca68f794640f7d37592c.zip
sched: _cpu_down(): Don't play with current->cpus_allowed
_cpu_down() changes the current task's affinity and then recovers it at the end. The problems are well known: we can't restore old_allowed if it was bound to the now-dead-cpu, and we can race with the userspace which can change cpu-affinity during unplug. _cpu_down() should not play with current->cpus_allowed at all. Instead, take_cpu_down() can migrate the caller of _cpu_down() after __cpu_disable() removes the dying cpu from cpu_online_mask. [ upstream commit: 6a1bdc1b577ebcb65f6603c57f8347309bc4ab13 ] Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <20100315091023.GA9148@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 21947b587171..32c3f6cd4d7f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2036,6 +2036,7 @@ extern void sched_clock_idle_sleep_event(void);
extern void sched_clock_idle_wakeup_event(u64 delta_ns);
#ifdef CONFIG_HOTPLUG_CPU
+extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
extern void idle_task_exit(void);
#else
static inline void idle_task_exit(void) {}