aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Galbraith <umgwanakikbuti@gmail.com>2015-03-24 08:14:49 +0100
committerAnders Roxell <anders.roxell@linaro.org>2015-06-01 12:03:40 +0200
commit443f4109a72f13afacfb936a3752ac207b64fb29 (patch)
tree8c023ae60eae18bc7b140d446317c5d5cc1a1ab9
parentd56c3d287187aae16fd509113592e4024cfcbe3a (diff)
downloadlinux-linaro-stable-443f4109a72f13afacfb936a3752ac207b64fb29.tar.gz
hotplug: Use set_cpus_allowed_ptr() in sync_unplug_thread()
do_set_cpus_allowed() is not safe vs ->sched_class change. crash> bt PID: 11676 TASK: ffff88026f979da0 CPU: 22 COMMAND: "sync_unplug/22" #0 [ffff880274d25bc8] machine_kexec at ffffffff8103b41c #1 [ffff880274d25c18] crash_kexec at ffffffff810d881a #2 [ffff880274d25cd8] oops_end at ffffffff81525818 #3 [ffff880274d25cf8] do_invalid_op at ffffffff81003096 #4 [ffff880274d25d90] invalid_op at ffffffff8152d3de [exception RIP: set_cpus_allowed_rt+18] RIP: ffffffff8109e012 RSP: ffff880274d25e48 RFLAGS: 00010202 RAX: ffffffff8109e000 RBX: ffff88026f979da0 RCX: ffff8802770cb6e8 RDX: 0000000000000000 RSI: ffffffff81add700 RDI: ffff88026f979da0 RBP: ffff880274d25e78 R8: ffffffff816112e0 R9: 0000000000000001 R10: 0000000000000001 R11: 0000000000011940 R12: ffff88026f979da0 R13: ffff8802770cb6d0 R14: ffff880274d25fd8 R15: 0000000000000000 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #5 [ffff880274d25e60] do_set_cpus_allowed at ffffffff8108e65f #6 [ffff880274d25e80] sync_unplug_thread at ffffffff81058c08 #7 [ffff880274d25ed8] kthread at ffffffff8107cad6 #8 [ffff880274d25f50] ret_from_fork at ffffffff8152bbbc crash> task_struct ffff88026f979da0 | grep class sched_class = 0xffffffff816111e0 <fair_sched_class+64>, Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 285e18b2c420..a3890754e407 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -242,7 +242,7 @@ static int sync_unplug_thread(void *data)
* we don't want any more work on this CPU.
*/
current->flags &= ~PF_NO_SETAFFINITY;
- do_set_cpus_allowed(current, cpu_present_mask);
+ set_cpus_allowed_ptr(current, cpu_present_mask);
migrate_me();
return 0;
}