From: Oleg Nesterov Date: Mon, 15 Mar 2010 09:10:23 +0000 (+0100) Subject: sched: _cpu_down(): Don't play with current->cpus_allowed X-Git-Tag: v2.6.35-rc1~521^2~24 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a1bdc1b577ebcb65f6603c57f8347309bc4ab13;p=pandora-kernel.git 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. Signed-off-by: Oleg Nesterov Acked-by: Rafael J. Wysocki Signed-off-by: Peter Zijlstra LKML-Reference: <20100315091023.GA9148@redhat.com> Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed