Skip to content

Commit 7675361

Browse files
johnstultz-workPeter Zijlstra
authored andcommitted
sched: deadline: Cleanup goto label in pick_earliest_pushable_dl_task
Commit 8b5e770 ("sched/deadline: Optimize pull_dl_task()") added a goto label seems would be better written as a while loop. So replace the goto with a while loop, to make it easier to read. Reported-by: Todd Kjos <[email protected]> Signed-off-by: John Stultz <[email protected]> Reviewed-and-tested-by: K Prateek Nayak <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Juri Lelli <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7d5265f commit 7675361

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/sched/deadline.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,16 +2516,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
25162516
return NULL;
25172517

25182518
next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root);
2519-
2520-
next_node:
2521-
if (next_node) {
2519+
while (next_node) {
25222520
p = __node_2_pdl(next_node);
25232521

25242522
if (task_is_pushable(rq, p, cpu))
25252523
return p;
25262524

25272525
next_node = rb_next(next_node);
2528-
goto next_node;
25292526
}
25302527

25312528
return NULL;

0 commit comments

Comments
 (0)