From: Valentin Schneider <valentin.schneider@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
linux-kernel@vger.kernel.org, joel@joelfernandes.org
Cc: fweisbec@gmail.com, tglx@linutronix.de, qais.yousef@arm.com,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 6/7 v3] sched/fair: trigger the update of blocked load on newly idle cpu
Date: Fri, 12 Feb 2021 19:19:41 +0000 [thread overview]
Message-ID: <jhj5z2xt7oy.mognet@arm.com> (raw)
In-Reply-To: <20210212141744.24284-7-vincent.guittot@linaro.org>
On 12/02/21 15:17, Vincent Guittot wrote:
> Instead of waking up a random and already idle CPU, we can take advantage
> of this_cpu being about to enter idle to run the ILB and update the
> blocked load.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> kernel/sched/fair.c | 24 +++++++++++++++++++++---
> kernel/sched/idle.c | 6 ++++++
> kernel/sched/sched.h | 5 +++++
> 3 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5d285d93e433..cd0ea635225e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -10453,6 +10453,24 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
> return true;
> }
>
> +/*
> + * Check if we need to run the ILB for updating blocked load before entering
> + * idle state.
> + */
> +void nohz_run_idle_balance(int cpu)
> +{
> + unsigned int flags;
> +
> + flags = atomic_fetch_andnot(NOHZ_KICK_MASK, nohz_flags(cpu));
> +
> + if (flags && !need_resched()) {
> + struct rq *rq = cpu_rq(cpu);
> +
> + rq->nohz_idle_balance = flags;
> + nohz_idle_balance(rq, CPU_IDLE);
> + }
So this can now run a full fledged nohz_idle_balance() if NOHZ_BALANCE_MASK
is set.
I don't think there is anything inherently wrong with it - the
nohz_idle_balance() call resulting from the kick_ilb() IPI will just bail
out due to the flags being cleared here. This wasn't immediately clear to
me however.
> +}
> +
next prev parent reply other threads:[~2021-02-12 19:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 14:17 [PATCH 0/7 v3] move update blocked load outside newidle_balance Vincent Guittot
2021-02-12 14:17 ` [PATCH 1/7 v3] sched/fair: remove update of blocked load from newidle_balance Vincent Guittot
2021-02-12 14:17 ` [PATCH 2/7 v3] sched/fair: remove unused return of _nohz_idle_balance Vincent Guittot
2021-02-12 14:17 ` [PATCH 3/7 v3] sched/fair: remove unused parameter of update_nohz_stats Vincent Guittot
2021-02-12 14:17 ` [PATCH 4/7 v3] sched/fair: merge for each idle cpu loop of ILB Vincent Guittot
2021-02-12 14:17 ` [PATCH 5/7 v3] sched/fair: reorder newidle_balance pulled_task tests Vincent Guittot
2021-02-12 14:17 ` [PATCH 6/7 v3] sched/fair: trigger the update of blocked load on newly idle cpu Vincent Guittot
2021-02-12 19:19 ` Valentin Schneider [this message]
2021-02-15 15:02 ` Vincent Guittot
2021-02-17 11:51 ` Valentin Schneider
2021-02-17 15:34 ` Vincent Guittot
2021-02-12 14:17 ` [PATCH 7/7 v3] sched/fair: reduce the window for duplicated update Vincent Guittot
2021-02-12 19:19 ` Valentin Schneider
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=jhj5z2xt7oy.mognet@arm.com \
--to=valentin.schneider@arm.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox