[PATCH 1/2] sched/deadline: minor code cleanups

From: Shrikanth Hegde

Date: Tue Oct 14 2025 - 06:04:09 EST


- In dl_server_timer, there is same dl_runtime check above. So
this check is duplicate. This could save a few cycles.

- In select_task_rq_dl, there is only one goto statement, there is
no need for it.

No functional changes.

Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
kernel/sched/deadline.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 7b7671060bf9..8b7c4ee41fd8 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1166,9 +1166,6 @@ static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_
sched_clock_tick();
update_rq_clock(rq);

- if (!dl_se->dl_runtime)
- return HRTIMER_NORESTART;
-
if (dl_se->dl_defer_armed) {
/*
* First check if the server could consume runtime in background.
@@ -2173,7 +2170,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int flags)
struct rq *rq;

if (!(flags & WF_TTWU))
- goto out;
+ return cpu;

rq = cpu_rq(cpu);

@@ -2211,7 +2208,6 @@ select_task_rq_dl(struct task_struct *p, int cpu, int flags)
}
rcu_read_unlock();

-out:
return cpu;
}

--
2.47.3