diff options
| author | Nickolai Zeldovich <nickolai@csail.mit.edu> | 2026-10-25 08:46:57 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2026-11-06 10:00:50 +0100 |
| commit | 0c93e25ef11a9dee43f6076bd1f09771dc2b167e (patch) | |
| tree | 7eff74007a78d83052bb5c6d0b9b19d815adb288 /tools/lib/python | |
| parent | d68ce4e71248e1ff5af9654b407541d9260b3ba5 (diff) | |
sched/deadline: Fix this_bw on class change of a dying task
Moving a SCHED_DEADLINE task out of the class with sched_setscheduler(2)
after it stored TASK_DEAD in do_task_dead(), but before __schedule()
dequeued it, subtracts its bandwidth from the runqueue's this_bw twice.
this_bw then stays short until reboot: __sub_rq_bw() warns about the
underflow or about running_bw > this_bw, and GRUB reclaim for
SCHED_FLAG_RECLAIM tasks on that CPU is miscomputed.
The class change dequeues the still queued task with DEQUEUE_SAVE, which
removes its bandwidth from running_bw and this_bw. switched_from_dl()
then calls task_non_contending(), which, if the 0-lag time has passed,
removes it from this_bw again because the task is TASK_DEAD. That
removal is meant for the dying task's own DEQUEUE_SLEEP dequeue, which
has removed nothing before it.
Do the TASK_DEAD removal only on that dequeue path.
Reproduced under QEMU on x86_64 and riscv64 by moving exiting deadline
tasks to SCHED_OTHER in a loop; with this patch there is no warning.
Fixes: 8fd27231c330 ("sched/deadline: Track the "total rq utilization" too")
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20261025124657.836229-1-nickolai@csail.mit.edu
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
