[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ebddd33-4666-1e6e-7788-a3fe28c9e99c@arm.com>
Date: Wed, 7 Apr 2021 15:11:34 +0100
From: Pierre <pierre.gondois@....com>
To: Xuewen Yan <xuewen.yan94@...il.com>,
Dietmar Eggemann <Dietmar.Eggemann@....com>, qperret@...gle.com
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Steven Rostedt <rostedt@...dmis.org>,
Benjamin Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Chunyan Zhang <zhang.lyra@...il.com>,
Ryan Y <xuewyan@...mail.com>
Subject: Re: [PATCH] sched/fair: use signed long when compute energy delta in
eas
Hi,
> I test the patch, but the overflow still exists.
> In the "sched/fair: Use pd_cache to speed up find_energy_efficient_cpu()"
> I wonder why recompute the cpu util when cpu==dst_cpu in compute_energy(),
> when the dst_cpu's util change, it also would cause the overflow.
The patches aim to cache the energy values for the CPUs whose
utilization is not modified (so we don't have to compute it multiple
times). The values cached are the 'base values' of the CPUs, i.e. when
the task is not placed on the CPU. When (cpu==dst_cpu) in
compute_energy(), it means the energy values need to be updated instead
of using the cached ones.
You are right, there is still a possibility to have a negative delta
with the patches at:
https://gitlab.arm.com/linux-arm/linux-power/-/commits/eas/next/integration-20210129
Adding a check before subtracting the values, and bailing out in such
case would avoid this, such as at:
https://gitlab.arm.com/linux-arm/linux-pg/-/commits/feec_bail_out/
I think a similar modification should be done in your patch. Even though
this is a good idea to group the calls to compute_energy() to reduce the
chances of having updates of utilization values in between the
compute_energy() calls,
there is still a chance to have updates. I think it happened when I
applied your patch.
About changing the delta(s) from 'unsigned long' to 'long', I am not
sure of the meaning of having a negative delta. I thing it would be
better to check and fail before it happens instead.
Regards
Powered by blists - more mailing lists