]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched/deadline: Avoid double update_rq_clock()
authorPeter Zijlstra <peterz@infradead.org>
Tue, 13 Jan 2026 11:57:14 +0000 (12:57 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 15 Jan 2026 20:57:52 +0000 (21:57 +0100)
When setup_new_dl_entity() is called from enqueue_task_dl() ->
enqueue_dl_entity(), the rq-clock should already be updated, and
calling update_rq_clock() again is not right.

Move the update_rq_clock() to the one other caller of
setup_new_dl_entity(): sched_init_dl_server().

Fixes: 9f239df55546 ("sched/deadline: Initialize dl_servers after SMP")
Reported-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
Link: https://patch.msgid.link/20260113115622.GA831285@noisy.programming.kicks-ass.net
kernel/sched/deadline.c

index b7acf74b6527c43272456f583482a740eccb5f12..5d6f3cced7401a3b3a705c5491c3bb028165c4b5 100644 (file)
@@ -752,8 +752,6 @@ static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se)
        struct dl_rq *dl_rq = dl_rq_of_se(dl_se);
        struct rq *rq = rq_of_dl_rq(dl_rq);
 
-       update_rq_clock(rq);
-
        WARN_ON(is_dl_boosted(dl_se));
        WARN_ON(dl_time_before(rq_clock(rq), dl_se->deadline));
 
@@ -1839,6 +1837,7 @@ void sched_init_dl_servers(void)
                rq = cpu_rq(cpu);
 
                guard(rq_lock_irq)(rq);
+               update_rq_clock(rq);
 
                dl_se = &rq->fair_server;