]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit - kernel/sched/fair.c
sched: Prevent raising SCHED_SOFTIRQ when CPU is !active
authorAnna-Maria Behnsen <anna-maria@linutronix.de>
Tue, 15 Dec 2020 10:44:00 +0000 (11:44 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 14 Jan 2021 10:20:09 +0000 (11:20 +0100)
commite0b257c3b71bd98a4866c3daecf000998aaa4927
treeb7df2348be4737a71b201caa0e8c78420c48abc1
parentd1515851ca075ed98fe78ac6abf24ba2dd25a63b
sched: Prevent raising SCHED_SOFTIRQ when CPU is !active

SCHED_SOFTIRQ is raised to trigger periodic load balancing. When CPU is not
active, CPU should not participate in load balancing.

The scheduler uses nohz.idle_cpus_mask to keep track of the CPUs which can
do idle load balancing. When bringing a CPU up the CPU is added to the mask
when it reaches the active state, but on teardown the CPU stays in the mask
until it goes offline and invokes sched_cpu_dying().

When SCHED_SOFTIRQ is raised on a !active CPU, there might be a pending
softirq when stopping the tick which triggers a warning in NOHZ code. The
SCHED_SOFTIRQ can also be raised by the scheduler tick which has the same
issue.

Therefore remove the CPU from nohz.idle_cpus_mask when it is marked
inactive and also prevent the scheduler_tick() from raising SCHED_SOFTIRQ
after this point.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lkml.kernel.org/r/20201215104400.9435-1-anna-maria@linutronix.de
kernel/sched/core.c
kernel/sched/fair.c