OSDN Git Service

sched/core: Wait for tasks being pushed away on hotplug
authorThomas Gleixner <tglx@linutronix.de>
Mon, 14 Sep 2020 12:47:28 +0000 (14:47 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 10 Nov 2020 17:38:58 +0000 (18:38 +0100)
commitf2469a1fb43f85d243ce72638367fb6e15c33491
tree0575cfc3c78c21e30a5766f589ed76328ebca2d7
parent2558aacff8586699bcd248b406febb28b0a25de2
sched/core: Wait for tasks being pushed away on hotplug

RT kernels need to ensure that all tasks which are not per CPU kthreads
have left the outgoing CPU to guarantee that no tasks are force migrated
within a migrate disabled section.

There is also some desire to (ab)use fine grained CPU hotplug control to
clear a CPU from active state to force migrate tasks which are not per CPU
kthreads away for power control purposes.

Add a mechanism which waits until all tasks which should leave the CPU
after the CPU active flag is cleared have moved to a different online CPU.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Link: https://lkml.kernel.org/r/20201023102346.377836842@infradead.org
kernel/sched/core.c
kernel/sched/sched.h