[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <jhj5z2xt7oy.mognet@arm.com>
Date: Fri, 12 Feb 2021 19:19:41 +0000
From: Valentin Schneider <valentin.schneider@....com>
To: Vincent Guittot <vincent.guittot@...aro.org>, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, linux-kernel@...r.kernel.org,
joel@...lfernandes.org
Cc: fweisbec@...il.com, tglx@...utronix.de, qais.yousef@....com,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH 6/7 v3] sched/fair: trigger the update of blocked load on newly idle cpu
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@...aro.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.
> +}
> +
Powered by blists - more mailing lists