]> git.ipfire.org Git - thirdparty/linux.git/commit
sched/debug: Fix dl_server (re)start conditions
authorPeter Zijlstra <peterz@infradead.org>
Tue, 3 Feb 2026 10:05:12 +0000 (11:05 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 3 Feb 2026 11:04:18 +0000 (12:04 +0100)
commit5a40a9bb56d455e7548ba4b6d7787918323cbaf0
treecb6aaa9edb0fbbe06272a5f2ad19fbfbfba44cd2
parent76d12132ba459ab929cb66eb2030c666aacdb69a
sched/debug: Fix dl_server (re)start conditions

There are two problems with sched_server_write_common() that can cause the
dl_server to malfunction upon attempting to change the parameters:

1) when, after having disabled the dl_server by setting runtime=0, it is
   enabled again while tasks are already enqueued. In this case is_active would
   still be 0 and dl_server_start() would not be called.

2) when dl_server_apply_params() would fail, runtime is not applied and does
   not reflect the new state.

Instead have dl_server_start() check its actual dl_runtime, and have
sched_server_write_common() unconditionally (re)start the dl_server. It will
automatically stop if there isn't anything to do, so spurious activation is
harmless -- while failing to start it is a problem.

While there, move the printk out of the locked region and make it symmetric,
also printing on enable.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260203103407.GK1282955@noisy.programming.kicks-ass.net
kernel/sched/deadline.c
kernel/sched/debug.c