sched/core: Fix rules for running on online && !active CPUs
authorPeter Zijlstra <peterz@infradead.org>
Tue, 25 Jul 2017 16:58:21 +0000 (18:58 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 31 May 2018 10:24:24 +0000 (12:24 +0200)
commit175f0e25abeaa2218d431141ce19cf1de70fa82d
treebbdd1a283a4fb22431e3be75169a7cf4599f0aee
parent786b71f5b754273ccef6d9462e52062b3e1f9877
sched/core: Fix rules for running on online && !active CPUs

As already enforced by the WARN() in __set_cpus_allowed_ptr(), the rules
for running on an online && !active CPU are stricter than just being a
kthread, you need to be a per-cpu kthread.

If you're not strictly per-CPU, you have better CPUs to run on and
don't need the partially booted one to get your work done.

The exception is to allow smpboot threads to bootstrap the CPU itself
and get kernel 'services' initialized before we allow userspace on it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 955dbdf4ce87 ("sched: Allow migrating kthreads into online but inactive CPUs")
Link: http://lkml.kernel.org/r/20170725165821.cejhb7v2s3kecems@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c