[PATCH 0/4] sched/deadline: Fix assorted dl_bw accounting bugs

From: Juri Lelli

Date: Tue Nov 03 2026 - 07:28:40 EST


This series fixes several SCHED_DEADLINE bandwidth accounting bugs that
can cause total_bw to leak or underflow, eventually blocking new
SCHED_DEADLINE admissions and CPU offlining with -EBUSY.

Patch 1 fixes stale root domain lookups during cpuset bandwidth
transfers for sleeping tasks, by using the task's cpus_mask instead of
the potentially stale task_rq(p)->rd.

Patch 2 fixes a total_bw leak when switching a non-queued task away
from SCHED_DEADLINE, where neither switched_from_dl() nor the inactive
timer would release the reserved bandwidth.

Patch 3 rejects the contradictory combination of SCHED_FLAG_KEEP_PARAMS
with a policy change that would switch the scheduling class, which
corrupts bandwidth accounting via spurious switched_from_dl() calls.

Patch 4 rejects sched_setattr(SCHED_DEADLINE) on exited (zombie) tasks,
which charge total_bw but never release it since the task will not run
again.

Series also available at

https://github.com/jlelli/linux.git b4/sched-dl-bw-fixes

Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
---
Juri Lelli (4):
sched/deadline: Fix stale root domain in cpuset bandwidth transfer
sched/deadline: Fix total_bw leak when switching away from SCHED_DEADLINE while !queued
sched: Reject SCHED_FLAG_KEEP_PARAMS when it would change scheduling class
sched/deadline: Reject SCHED_DEADLINE on exited tasks

kernel/sched/deadline.c | 63 ++++++++++++++++++++++++++++++++++++++-----------
kernel/sched/syscalls.c | 23 +++++++++++++++++-
2 files changed, 71 insertions(+), 15 deletions(-)
---
base-commit: b99b7f60c5b473d374c68b53753153b4aa9e0702
change-id: 20261103-b4-sched-dl-bw-fixes-9b921aa91b71

Best regards,
--
Juri Lelli <juri.lelli@xxxxxxxxxx>