[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8735mn8abx.mognet@arm.com>
Date: Mon, 20 Dec 2021 17:17:38 +0000
From: Valentin Schneider <valentin.schneider@....com>
To: Vincent Donnefort <vincent.donnefort@....com>,
peterz@...radead.org, mingo@...hat.com, vincent.guittot@...aro.org
Cc: linux-kernel@...r.kernel.org, dietmar.eggemann@....com,
morten.rasmussen@....com, qperret@...gle.com,
Vincent Donnefort <vincent.donnefort@....com>
Subject: Re: [PATCH 3/3] sched/fair: Do not raise overutilized for idle CPUs
On 20/12/21 12:43, Vincent Donnefort wrote:
> During a migration, the lock for the previous runqueue is not taken and
> hence, the task contribution isn't directly removed from that runqueue
> utilization but instead temporarily saved, until the next PELT signals
> update where it would be accounted. There is then a window in which a
> CPU can ben idle be nonetheless overutilized.
>
> The load balancer wouldn't be able to do anything to help a sleeping CPU,
> it brings then no gain to raise overutilized there, only the risk of
> spuriously doing it.
>
> Signed-off-by: Vincent Donnefort <vincent.donnefort@....com>
>
Reviewed-by: Valentin Schneider <valentin.schneider@....com>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 51f6f55abb37..37f737c5f0b8 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8641,26 +8641,28 @@ static inline void update_sg_lb_stats(struct lb_env *env,
>
> nr_running = rq->nr_running;
> sgs->sum_nr_running += nr_running;
> -
> - if (nr_running > 1)
> - *sg_status |= SG_OVERLOAD;
> -
> - if (cpu_overutilized(i))
> - *sg_status |= SG_OVERUTILIZED;
> -
> #ifdef CONFIG_NUMA_BALANCING
> sgs->nr_numa_running += rq->nr_numa_running;
> sgs->nr_preferred_running += rq->nr_preferred_running;
> #endif
> + if (nr_running > 1)
> + *sg_status |= SG_OVERLOAD;
> +
> /*
> * No need to call idle_cpu() if nr_running is not 0
> */
> if (!nr_running && idle_cpu(i)) {
> sgs->idle_cpus++;
> - /* Idle cpu can't have misfit task */
> + /*
> + * Idle cpu can neither be overutilized nor have a
> + * misfit task.
> + */
> continue;
> }
>
> + if (cpu_overutilized(i))
> + *sg_status |= SG_OVERUTILIZED;
> +
> if (local_group)
> continue;
>
> --
> 2.25.1
Powered by blists - more mailing lists