[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94bc116e-0ef0-475a-ad00-b994bf0edca9@amd.com>
Date: Fri, 6 Dec 2024 13:44:42 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: John Stultz <jstultz@...gle.com>
CC: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot
<vincent.guittot@...aro.org>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel
Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>, Wanpeng
Li <wanpeng.li@...ux.intel.com>, Christophe JAILLET
<christophe.jaillet@...adoo.fr>, Todd Kjos <tkjos@...gle.com>,
<kernel-team@...roid.com>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] sched: deadline: Cleanup goto label in
pick_earliest_pushable_dl_task
Hello John,
On 12/6/2024 5:29 AM, John Stultz wrote:
> Commit 8b5e770ed7c0 ("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.
>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Juri Lelli <juri.lelli@...hat.com>
> Cc: Vincent Guittot <vincent.guittot@...aro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@....com>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Ben Segall <bsegall@...gle.com>
> Cc: Mel Gorman <mgorman@...e.de>
> Cc: Valentin Schneider <vschneid@...hat.com>
> Cc: Wanpeng Li <wanpeng.li@...ux.intel.com>
> Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Cc: Todd Kjos <tkjos@...gle.com>
> Cc: kernel-team@...roid.com
> Reported-by: Todd Kjos <tkjos@...gle.com>
> Signed-off-by: John Stultz <jstultz@...gle.com>
Gave it a spin on my box. Feel free to add:
Reviewed-and-tested-by: K Prateek Nayak <kprateek.nayak@....com>
--
Thanks and Regards,
Prateek
> ---
> v2:
> * Corrects my misreading of the code (as pointed out by Christophe
> JAILLET) as already having a while loop, and switches the if to
> a while.
> ---
> kernel/sched/deadline.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d9d5a702f1a61..b2cc71984176a 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2501,16 +2501,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
> return NULL;
>
> 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 (task_is_pushable(rq, p, cpu))
> return p;
>
> next_node = rb_next(next_node);
> - goto next_node;
> }
>
> return NULL;
Powered by blists - more mailing lists