Skip to content

Commit 4de9ff7

Browse files
author
Peter Zijlstra
committed
sched/deadline: Avoid double update_rq_clock()
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: 9f239df ("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
1 parent 375410b commit 4de9ff7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/sched/deadline.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,6 @@ static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se)
752752
struct dl_rq *dl_rq = dl_rq_of_se(dl_se);
753753
struct rq *rq = rq_of_dl_rq(dl_rq);
754754

755-
update_rq_clock(rq);
756-
757755
WARN_ON(is_dl_boosted(dl_se));
758756
WARN_ON(dl_time_before(rq_clock(rq), dl_se->deadline));
759757

@@ -1839,6 +1837,7 @@ void sched_init_dl_servers(void)
18391837
rq = cpu_rq(cpu);
18401838

18411839
guard(rq_lock_irq)(rq);
1840+
update_rq_clock(rq);
18421841

18431842
dl_se = &rq->fair_server;
18441843

0 commit comments

Comments
 (0)