mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Wanpeng Li <wanpeng.li@linux.intel.com>,
	Todd Kjos <tkjos@google.com>,
	kernel-team@android.com
Subject: Re: [RFC][PATCH] sched: deadline: Remove unnecessary goto label in pick_earliest_pushable_dl_task
Date: Thu, 5 Dec 2024 22:23:17 +0100	[thread overview]
Message-ID: <06444675-136e-442f-918b-e7887d2c535b@wanadoo.fr> (raw)
In-Reply-To: <20241205211632.1181715-1-jstultz@google.com>

Le 05/12/2024 à 22:16, John Stultz a écrit :
> Commit 8b5e770ed7c0 ("sched/deadline: Optimize pull_dl_task()")
> added an odd goto label that seems to be unnecssary, given its

s/unnecssary/unnecessary/

> called unconditionally from the bottom of a while loop and the
> label is at the top.

Except that it is not a while loop, but only an if.

Maybe, changing this if into a while would save a few lines of code and 
be more readable as-well.

CJ

> 
> Thus, clean it up and remove the label/goto.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Valentin Schneider <vschneid@redhat.com>
> Cc: Wanpeng Li <wanpeng.li@linux.intel.com>
> Cc: Todd Kjos <tkjos@google.com>
> Cc: kernel-team@android.com
> Fixes: 8b5e770ed7c0 ("sched/deadline: Optimize pull_dl_task()")
> Reported-by: Todd Kjos <tkjos@google.com>
> Signed-off-by: John Stultz <jstultz@google.com>
> ---
>   kernel/sched/deadline.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d9d5a702f1a61..566a05efa4e57 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2501,8 +2501,6 @@ 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) {
>   		p = __node_2_pdl(next_node);
>   
> @@ -2510,7 +2508,6 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
>   			return p;
>   
>   		next_node = rb_next(next_node);
> -		goto next_node;
>   	}
>   
>   	return NULL;



WARNING: multiple messages have this Message-ID
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: John Stultz <jstultz@google.com>, LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Wanpeng Li <wanpeng.li@linux.intel.com>,
	Todd Kjos <tkjos@google.com>,
	kernel-team@android.com
Subject: Re: [RFC][PATCH] sched: deadline: Remove unnecessary goto label in pick_earliest_pushable_dl_task
Date: Thu, 5 Dec 2024 22:23:17 +0100	[thread overview]
Message-ID: <06444675-136e-442f-918b-e7887d2c535b@wanadoo.fr> (raw)
Message-ID: <20241205212317.N7DHS7SMD1C7ayVocCE47I6dDaduKQatqJC-L3MtzPo@z> (raw)
In-Reply-To: <20241205211632.1181715-1-jstultz@google.com>

Le 05/12/2024 à 22:16, John Stultz a écrit :
> Commit 8b5e770ed7c0 ("sched/deadline: Optimize pull_dl_task()")
> added an odd goto label that seems to be unnecssary, given its

s/unnecssary/unnecessary/

> called unconditionally from the bottom of a while loop and the
> label is at the top.

Except that it is not a while loop, but only an if.

Maybe, changing this if into a while would save a few lines of code and 
be more readable as-well.

CJ

> 
> Thus, clean it up and remove the label/goto.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Valentin Schneider <vschneid@redhat.com>
> Cc: Wanpeng Li <wanpeng.li@linux.intel.com>
> Cc: Todd Kjos <tkjos@google.com>
> Cc: kernel-team@android.com
> Fixes: 8b5e770ed7c0 ("sched/deadline: Optimize pull_dl_task()")
> Reported-by: Todd Kjos <tkjos@google.com>
> Signed-off-by: John Stultz <jstultz@google.com>
> ---
>   kernel/sched/deadline.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d9d5a702f1a61..566a05efa4e57 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2501,8 +2501,6 @@ 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) {
>   		p = __node_2_pdl(next_node);
>   
> @@ -2510,7 +2508,6 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
>   			return p;
>   
>   		next_node = rb_next(next_node);
> -		goto next_node;
>   	}
>   
>   	return NULL;


  reply	other threads:[~2024-12-05 21:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 21:16 John Stultz
2024-12-05 21:23 ` Christophe JAILLET [this message]
2024-12-05 21:23   ` Christophe JAILLET
2024-12-05 21:47   ` John Stultz
2024-12-05 23:59 ` [PATCH v2] sched: deadline: Cleanup " John Stultz
2024-12-06  8:14   ` K Prateek Nayak
2024-12-09 11:44   ` Juri Lelli
2024-12-09 12:01   ` Peter Zijlstra
2024-12-13 12:05   ` [tip: sched/core] " tip-bot2 for John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06444675-136e-442f-918b-e7887d2c535b@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tkjos@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=wanpeng.li@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®