From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Qais Yousef <qyousef@layalina.io>,
Vincent Guittot <vincent.guittot@linaro.org>
Cc: Xuewen Yan <xuewen.yan94@gmail.com>,
Xuewen Yan <xuewen.yan@unisoc.com>,
mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com,
vincent.donnefort@arm.com, ke.wang@unisoc.com,
linux-kernel@vger.kernel.org, christian.loehle@arm.com
Subject: Re: [PATCH] sched/fair: Prevent cpu_busy_time from exceeding actual_cpu_capacity
Date: Fri, 21 Jun 2024 10:22:40 +0200 [thread overview]
Message-ID: <3bfb4e65-b746-449e-a9e7-acda24897045@arm.com> (raw)
In-Reply-To: <20240620113756.hivzk7sj4uj4sm6j@airbuntu>
On 20/06/2024 13:37, Qais Yousef wrote:
> On 06/20/24 09:45, Vincent Guittot wrote:
>> On Wed, 19 Jun 2024 at 20:10, Qais Yousef <qyousef@layalina.io> wrote:
>>>
>>> On 06/19/24 11:05, Xuewen Yan wrote:
>>>> On Tue, Jun 18, 2024 at 11:39 PM Qais Yousef <qyousef@layalina.io> wrote:
>>>>>
>>>>> On 06/18/24 17:23, Vincent Guittot wrote:
>>>>>> On Mon, 17 Jun 2024 at 12:53, Qais Yousef <qyousef@layalina.io> wrote:
>>>>>>>
>>>>>>> On 06/17/24 11:07, Vincent Guittot wrote:
[...]
>>>> diff --git a/drivers/thermal/cpufreq_cooling.c
>>>> b/drivers/thermal/cpufreq_cooling.c
>>>> index 280071be30b1..a8546d69cc10 100644
>>>> --- a/drivers/thermal/cpufreq_cooling.c
>>>> +++ b/drivers/thermal/cpufreq_cooling.c
>>>> @@ -164,7 +164,7 @@ static u32 get_load(struct cpufreq_cooling_device
>>>> *cpufreq_cdev, int cpu,
>>>> {
>>>> unsigned long util = sched_cpu_util(cpu);
>>>>
>>>> - return (util * 100) / arch_scale_cpu_capacity(cpu);
>>>> + return (util * 100) / get_actual_cpu_capacity(cpu);
>>>> }
>>>> #else /* !CONFIG_SMP */
>>>> static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu,
>>>>
>>>>
>>>> Because if still use arch_scale_cpu_capacity(), the load pct may be decreased,
>>>> It may affect the thermal-IPA-governor's power consideration.
>>>
>>> I am not sure about this one. But looks plausible. Vincent?
>>
>> I don't see why we should change them ? We don't want to change
>> sched_cpu_util() as well
>> AFAICT, the only outcome of this thread is that we should use
>> get_actual_cpu_capacity() instead of arch_scale_cpu_capacity() in
>> util_fits_cpu(). capping the utilization only make the estimation
>> worse
>
> Yes my bad. Only util_fits_cpu() is needed now
Looks like that's for the uclamp part (2. part) of util_fits_cpu().
For the first part we use capacity_of() which bases on
get_actual_cpu_capacity() [scale_rt_capacity()] and changes each 4ms
[250 Hz].
Our assumption is that hw_load_avg() and cpufreq_get_pressure() change
way less frequent than that, right?
So we can use capacity_of() and get_actual_cpu_capacity() in the same
code path.
next prev parent reply other threads:[~2024-06-21 8:22 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 7:06 [PATCH] sched/fair: Prevent cpu_busy_time from exceeding actual_cpu_capacity Xuewen Yan
2024-06-07 7:19 ` Dietmar Eggemann
2024-06-07 8:20 ` Xuewen Yan
2024-06-07 10:30 ` Dietmar Eggemann
2024-06-07 10:37 ` Xuewen Yan
2024-06-21 10:22 ` Dietmar Eggemann
2024-06-24 2:27 ` Xuewen Yan
2024-06-09 22:55 ` Qais Yousef
2024-06-12 8:11 ` Xuewen Yan
2024-06-16 22:20 ` Qais Yousef
2024-06-17 7:27 ` Xuewen Yan
2024-06-17 11:03 ` Qais Yousef
2024-06-18 14:58 ` Qais Yousef
2024-06-19 2:46 ` Xuewen Yan
2024-06-19 18:03 ` Qais Yousef
2024-06-20 3:08 ` Xuewen Yan
2024-06-21 10:40 ` Dietmar Eggemann
2024-06-21 13:00 ` Vincent Guittot
2024-06-24 2:35 ` Xuewen Yan
2024-06-18 15:20 ` Vincent Guittot
2024-06-18 15:26 ` Qais Yousef
2024-06-17 9:07 ` Vincent Guittot
2024-06-17 10:53 ` Qais Yousef
2024-06-18 15:23 ` Vincent Guittot
2024-06-18 15:39 ` Qais Yousef
2024-06-18 21:05 ` Vincent Guittot
2024-06-19 18:01 ` Qais Yousef
2024-06-19 3:05 ` Xuewen Yan
2024-06-19 18:10 ` Qais Yousef
2024-06-20 7:45 ` Vincent Guittot
2024-06-20 11:37 ` Qais Yousef
2024-06-21 8:22 ` Dietmar Eggemann [this message]
2024-06-11 9:08 ` Christian Loehle
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=3bfb4e65-b746-449e-a9e7-acda24897045@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=christian.loehle@arm.com \
--cc=juri.lelli@redhat.com \
--cc=ke.wang@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qyousef@layalina.io \
--cc=rostedt@goodmis.org \
--cc=vincent.donnefort@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=xuewen.yan94@gmail.com \
--cc=xuewen.yan@unisoc.com \
/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