All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	fweisbec@gmail.com, tglx@linutronix.de, bristot@redhat.com,
	linux-kernel@vger.kernel.org, joel@joelfernandes.org
Cc: qais.yousef@arm.com
Subject: Re: [PATCH 4/6] sched/fair: reorder newidle_balance pulled_task test
Date: Tue, 9 Feb 2021 14:46:05 +0100	[thread overview]
Message-ID: <4ab3693c-615d-6ef0-f4b3-0f01b820b826@arm.com> (raw)
In-Reply-To: <20210205114830.781-5-vincent.guittot@linaro.org>

On 05/02/2021 12:48, Vincent Guittot wrote:
> Reorder the tests and skip prevent useless test when no load balance has
> been performed.

LGTM.

But IMHO the reason why those two if conditions can be skipped for the
'goto out' path is that we don't release the rq lock rather the actual
lb. Might be worth saying this in the patch header? It's already
mentioned on top of the first if condition though.

> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
>  kernel/sched/fair.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index c587af230010..935594cd5430 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -10592,7 +10592,6 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
>  	if (curr_cost > this_rq->max_idle_balance_cost)
>  		this_rq->max_idle_balance_cost = curr_cost;
>  
> -out:
>  	/*
>  	 * While browsing the domains, we released the rq lock, a task could
>  	 * have been enqueued in the meantime. Since we're not going idle,
> @@ -10601,14 +10600,15 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
>  	if (this_rq->cfs.h_nr_running && !pulled_task)
>  		pulled_task = 1;
>  
> -	/* Move the next balance forward */
> -	if (time_after(this_rq->next_balance, next_balance))
> -		this_rq->next_balance = next_balance;
> -
>  	/* Is there a task of a high priority class? */
>  	if (this_rq->nr_running != this_rq->cfs.h_nr_running)
>  		pulled_task = -1;
>  
> +out:
> +	/* Move the next balance forward */
> +	if (time_after(this_rq->next_balance, next_balance))
> +		this_rq->next_balance = next_balance;
> +
>  	if (pulled_task)
>  		this_rq->idle_stamp = 0;
>  	else
> 


  reply	other threads:[~2021-02-09 13:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 11:48 [PATCH 0/6] move update blocked load outside newidle_balance Vincent Guittot
2021-02-05 11:48 ` [PATCH 1/6] sched/fair: remove update of blocked load from newidle_balance Vincent Guittot
2021-02-09 13:09   ` Valentin Schneider
2021-02-09 13:20     ` Vincent Guittot
2021-02-09 13:44   ` Dietmar Eggemann
2021-02-05 11:48 ` [PATCH 2/6] sched/fair: remove unused parameter of update_nohz_stats Vincent Guittot
2021-02-09 13:45   ` Dietmar Eggemann
2021-02-09 17:38     ` Vincent Guittot
2021-02-05 11:48 ` [PATCH 3/6] sched/fair: merge for each idle cpu loop of ILB Vincent Guittot
2021-02-09 13:09   ` Valentin Schneider
2021-02-05 11:48 ` [PATCH 4/6] sched/fair: reorder newidle_balance pulled_task test Vincent Guittot
2021-02-09 13:46   ` Dietmar Eggemann [this message]
2021-02-05 11:48 ` [RFC PATCH 5/6] sched/fair: trigger the update of blocked load on newly idle cpu Vincent Guittot
2021-02-09 13:09   ` Valentin Schneider
2021-02-09 13:57     ` Vincent Guittot
2021-02-09 17:25       ` Valentin Schneider
2021-02-09 13:47   ` Dietmar Eggemann
2021-02-09 14:22     ` Vincent Guittot
2021-02-05 11:48 ` [PATCH 6/6] sched/fair: reduce the window for duplicated update Vincent Guittot
2021-02-05 15:13   ` kernel test robot
2021-02-05 16:13   ` [PATCH 6/6 v2] " Vincent Guittot

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=4ab3693c-615d-6ef0-f4b3-0f01b820b826@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=fweisbec@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qais.yousef@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.