]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
sched/deadline: Always stop dl-server before changing parameters
authorJuri Lelli <juri.lelli@redhat.com>
Mon, 21 Jul 2025 13:01:42 +0000 (15:01 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 26 Aug 2025 08:46:00 +0000 (10:46 +0200)
Commit cccb45d7c4295 ("sched/deadline: Less agressive dl_server
handling") reduced dl-server overhead by delaying disabling servers only
after there are no fair task around for a whole period, which means that
deadline entities are not dequeued right away on a server stop event.
However, the delay opens up a window in which a request for changing
server parameters can break per-runqueue running_bw tracking, as
reported by Yuri.

Close the problematic window by unconditionally calling dl_server_stop()
before applying the new parameters (ensuring deadline entities go
through an actual dequeue).

Fixes: cccb45d7c4295 ("sched/deadline: Less agressive dl_server handling")
Reported-by: Yuri Andriaccio <yurand2000@gmail.com>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Link: https://lore.kernel.org/r/20250721-upstream-fix-dlserver-lessaggressive-b4-v1-1-4ebc10c87e40@redhat.com
kernel/sched/debug.c

index 3f06ab84d53f0c0137323338e2ba0596feeeb2a5..02e16b70a7901e341b4d12dcc0d97752b66174d2 100644 (file)
@@ -376,10 +376,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
                        return  -EINVAL;
                }
 
-               if (rq->cfs.h_nr_queued) {
-                       update_rq_clock(rq);
-                       dl_server_stop(&rq->fair_server);
-               }
+               update_rq_clock(rq);
+               dl_server_stop(&rq->fair_server);
 
                retval = dl_server_apply_params(&rq->fair_server, runtime, period, 0);
                if (retval)