sched: Allow per-cpu kernel threads to run on online && !active
authorPeter Zijlstra (Intel) <peterz@infradead.org>
Thu, 10 Mar 2016 11:54:08 +0000 (12:54 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 6 May 2016 12:58:22 +0000 (14:58 +0200)
commite9d867a67fd03ccc07248ca4e9c2f74fed494d5b
treebd1e01ee5b5581203d3fa8397fd863c400cea2bc
parent04974df8049fc4240d22759a91e035082ccd18b4
sched: Allow per-cpu kernel threads to run on online && !active

In order to enable symmetric hotplug, we must mirror the online &&
!active state of cpu-down on the cpu-up side.

However, to retain sanity, limit this state to per-cpu kthreads.

Aside from the change to set_cpus_allowed_ptr(), which allow moving
the per-cpu kthreads on, the other critical piece is the cpu selection
for pinned tasks in select_task_rq(). This avoids dropping into
select_fallback_rq().

select_fallback_rq() cannot be allowed to select !active cpus because
its used to migrate user tasks away. And we do not want to move user
tasks onto cpus that are in transition.

Requested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Jan H. Schönherr <jschoenh@amazon.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160301152303.GV6356@twins.programming.kicks-ass.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/powerpc/kernel/smp.c
arch/s390/kernel/smp.c
include/linux/cpumask.h
kernel/sched/core.c