]> git.baikalelectronics.ru Git - kernel.git/commit
sched/hotplug: Ensure only per-cpu kthreads run during hotplug
authorPeter Zijlstra <peterz@infradead.org>
Fri, 11 Sep 2020 07:54:27 +0000 (09:54 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 10 Nov 2020 17:38:57 +0000 (18:38 +0100)
commit16311dffdd1a4e2cbce128b85d02df1116c0f0c4
treec8f47dc0cfccccadbc30bad72f842a0d12cf5a40
parent0e9f111dd7d0ebd3582a54a8220d5c212b516ad4
sched/hotplug: Ensure only per-cpu kthreads run during hotplug

In preparation for migrate_disable(), make sure only per-cpu kthreads
are allowed to run on !active CPUs.

This is ran (as one of the very first steps) from the cpu-hotplug
task which is a per-cpu kthread and completion of the hotplug
operation only requires such tasks.

This constraint enables the migrate_disable() implementation to wait
for completion of all migrate_disable regions on this CPU at hotplug
time without fear of any new ones starting.

This replaces the unlikely(rq->balance_callbacks) test at the tail of
context_switch with an unlikely(rq->balance_work), the fast path is
not affected.

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.292709163@infradead.org
kernel/sched/core.c
kernel/sched/sched.h