* Re: [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task()
2023-05-30 18:11 [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task() Li kunyu
@ 2023-05-29 6:29 ` Mukesh Ojha
0 siblings, 0 replies; 2+ messages in thread
From: Mukesh Ojha @ 2023-05-29 6:29 UTC (permalink / raw)
To: Li kunyu, mingo, peterz, juri.lelli, vincent.guittot,
dietmar.eggemann, rostedt, bsegall, mgorman, bristot, vschneid
Cc: linux-kernel
On 5/30/2023 11:41 PM, Li kunyu wrote:
> Using the while statement instead of the if and goto statements is more
> concise and efficient.
>
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
LGTM, Thanks.
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
-- Mukesh
> ---
> kernel/sched/deadline.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d823e608c7f0..b94a498f8cd9 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2112,15 +2112,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
>
> next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root);
>
> -next_node:
> - if (next_node) {
> + while (next_node) {
> p = __node_2_pdl(next_node);
>
> if (pick_dl_task(rq, p, cpu))
> return p;
>
> next_node = rb_next(next_node);
> - goto next_node;
> }
>
> return NULL;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task()
@ 2023-05-30 18:11 Li kunyu
2023-05-29 6:29 ` Mukesh Ojha
0 siblings, 1 reply; 2+ messages in thread
From: Li kunyu @ 2023-05-30 18:11 UTC (permalink / raw)
To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
rostedt, bsegall, mgorman, bristot, vschneid
Cc: linux-kernel, Li kunyu
Using the while statement instead of the if and goto statements is more
concise and efficient.
Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
kernel/sched/deadline.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index d823e608c7f0..b94a498f8cd9 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -2112,15 +2112,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root);
-next_node:
- if (next_node) {
+ while (next_node) {
p = __node_2_pdl(next_node);
if (pick_dl_task(rq, p, cpu))
return p;
next_node = rb_next(next_node);
- goto next_node;
}
return NULL;
--
2.18.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-29 6:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 18:11 [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task() Li kunyu
2023-05-29 6:29 ` Mukesh Ojha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).