linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Qais Yousef <qyousef@layalina.io>,
	Chris Redpath <Chris.Redpath@arm.com>
Subject: Re: [RFC PATCH 0/7] sched: cpufreq: Remove magic margins
Date: Wed, 13 Sep 2023 10:53:38 +0100	[thread overview]
Message-ID: <74c48141-55c4-c09b-250f-c1d71f031a8c@arm.com> (raw)
In-Reply-To: <CAKfTPtDd-HhF-YiNTtL9i5k0PfJbF819Yxu4YquzfXgwi7voyw@mail.gmail.com>

Hi Vincent,

On 9/12/23 15:01, Vincent Guittot wrote:
> Hi Lukasz,
> 
> On Tue, 12 Sept 2023 at 13:51, Lukasz Luba <lukasz.luba@arm.com> wrote:
>>
>> Hi Peter,
>>
>> On 9/7/23 21:16, Peter Zijlstra wrote:
>>> On Thu, Sep 07, 2023 at 03:42:13PM +0100, Lukasz Luba wrote:
>>>
>>>>> What task characteristic is tied to this? That is, this seems trivial to
>>>>> modify per-task.
>>>>
>>>> In particular Speedometer test and the main browser task, which reaches
>>>> ~900util, but sometimes vanish and waits for other background tasks
>>>> to do something. In the meantime it can decay and wake-up on
>>>> Mid/Little (which can cause a penalty to score up to 5-10% vs. if
>>>> we pin the task to big CPUs). So, a longer util_est helps to avoid
>>>> at least very bad down migration to Littles...
>>>
>>> Do they do a few short activations (wakeup/sleeps) while waiting? That
>>> would indeed completely ruin things since the EWMA thing is activation
>>> based.
>>>
>>> I wonder if there's anything sane we can do here...
>>
>> My apologies for a delay, I have tried to push the graphs for you.
>>
>> The experiment is on pixel7*. It's running the browser on the phone
>> with the test 'Speedometer 2.0'. It's a web test (you can also run on
>> your phone) available here, no need to install anything:
>> https://browserbench.org/Speedometer2.0/
>>
>> Here is the Jupiter notebook [1], with plots of the signals:
>> - top 20 tasks' (based on runtime) utilization
>> - Util EST signals for the top 20 tasks, with the longer decaying ewma
>>     filter (which is the 'red' plot called 'ewma')
>> - the main task (comm=CrRendererMain) Util, Util EST and task residency
>>     (which tires to stick to CPUs 6,7* )
>> - the test score was 144.6 (while with fast decay ewma is ~134), so
>>     staying at big cpus (helps the score in this case)
>>
>> (the plots are interactive, you can zoom in with the icon 'Box Zoom')
>> (e.g. you can zoom in the task activation plot which is also linked
>> with the 'Util EST' on top, for this main task)
>>
>> You can see the util signal of that 'CrRendererMain' task and those
>> utilization drops in time, which I was referring to. When the util
>> drops below some threshold, the task might 'fit' into smaller CPU,
>> which could be prevented automatically byt maintaining the util est
>> for longer (but not for all).
> 
> I was looking at your nice chart and I wonder if you could also add
> the runnable _avg of the tasks ?

Yes, I will try today or tomorrow to add such plots as well.

> 
> My 1st impression is that the decrease happens when your task starts
> to share the CPU with some other tasks and this ends up with a
> decrease of its utilization because util_avg doesn't take into account
> the waiting time so typically task with an utilization of 1024, will
> see its utilization decrease because of other tasks running on the
> same cpu. This would explain the drop that you can see.
> 
>   I wonder if we should not take into account the runnable_avg when
> applying the ewm on util_est ? so the util_est will not decrease
> because of time sharing with other

Yes, that sounds a good idea. Let me provide those plots so we could
go further with the analysis. I will try to capture if that happens
to that particular task on CPU (if there are some others as well).


Thanks for jumping in to the discussion!

Lukasz

  reply	other threads:[~2023-09-13  9:53 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 23:31 [RFC PATCH 0/7] sched: cpufreq: Remove magic margins Qais Yousef
2023-08-27 23:31 ` [RFC PATCH 1/7] sched/pelt: Add a new function to approximate the future util_avg value Qais Yousef
2023-09-06 12:56   ` Dietmar Eggemann
2023-09-06 21:19     ` Qais Yousef
2023-09-07 11:12       ` Dietmar Eggemann
2023-09-10 19:58         ` Qais Yousef
2023-09-13 17:22           ` Dietmar Eggemann
2023-09-16 19:49             ` Qais Yousef
2023-09-16 19:52               ` Qais Yousef
2023-08-27 23:31 ` [RFC PATCH 2/7] sched/pelt: Add a new function to approximate runtime to reach given util Qais Yousef
2023-09-06 12:56   ` Dietmar Eggemann
2023-09-06 20:44     ` Dietmar Eggemann
2023-09-06 21:38       ` Qais Yousef
2023-09-15  9:15   ` Hongyan Xia
2023-09-16 19:56     ` Qais Yousef
2023-08-27 23:31 ` [RFC PATCH 3/7] sched/fair: Remove magic margin in fits_capacity() Qais Yousef
2023-09-06 14:38   ` Dietmar Eggemann
2023-09-06 21:45     ` Qais Yousef
2023-08-27 23:32 ` [RFC PATCH 4/7] sched: cpufreq: Remove magic 1.25 headroom from apply_dvfs_headroom() Qais Yousef
2023-09-07 11:34   ` Peter Zijlstra
2023-09-10 19:23     ` Qais Yousef
2023-08-27 23:32 ` [RFC PATCH 5/7] sched/schedutil: Add a new tunable to dictate response time Qais Yousef
2023-09-06 21:13   ` Dietmar Eggemann
2023-09-06 21:52     ` Qais Yousef
2023-09-07 11:44   ` Peter Zijlstra
2023-09-10 19:25     ` Qais Yousef
2023-08-27 23:32 ` [RFC PATCH 6/7] sched/pelt: Introduce PELT multiplier Qais Yousef
2023-08-27 23:32 ` [RFC PATCH 7/7] cpufreq: Change default transition delay to 2ms Qais Yousef
2023-09-06  9:18 ` [RFC PATCH 0/7] sched: cpufreq: Remove magic margins Lukasz Luba
2023-09-06 21:18   ` Qais Yousef
2023-09-07  7:48     ` Lukasz Luba
2023-09-07 11:53       ` Peter Zijlstra
2023-09-07 13:06         ` Lukasz Luba
2023-09-07 13:29           ` Peter Zijlstra
2023-09-07 13:33             ` Lukasz Luba
2023-09-07 13:38               ` Peter Zijlstra
2023-09-07 13:45                 ` Lukasz Luba
2023-09-08 12:51                   ` Daniel Bristot de Oliveira
2023-09-12 11:57                     ` Lukasz Luba
2023-09-10 18:20         ` Qais Yousef
2023-09-10 18:14       ` Qais Yousef
2023-09-07 13:26     ` Peter Zijlstra
2023-09-07 13:57       ` Lukasz Luba
2023-09-07 14:29         ` Peter Zijlstra
2023-09-07 14:42           ` Lukasz Luba
2023-09-07 20:16             ` Peter Zijlstra
2023-09-12 11:51               ` Lukasz Luba
2023-09-12 14:01                 ` Vincent Guittot
2023-09-13  9:53                   ` Lukasz Luba [this message]
2023-09-12 14:28                 ` Peter Zijlstra
2023-09-10 19:06             ` Qais Yousef
2023-09-10 18:46       ` Qais Yousef
2023-09-07 13:08 ` Peter Zijlstra
2023-09-08  0:17   ` Qais Yousef
2023-09-08  7:40     ` Dietmar Eggemann
2023-09-08 14:07       ` Qais Yousef
2023-09-12 17:18         ` Dietmar Eggemann
2023-09-16 19:38           ` Qais Yousef
2023-09-08 10:25     ` Peter Zijlstra
2023-09-08 13:33       ` Qais Yousef
2023-09-08 13:58         ` Peter Zijlstra
2023-09-08 13:59         ` Peter Zijlstra
2023-09-08 14:11           ` Qais Yousef
2023-09-10 21:17         ` Qais Yousef

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=74c48141-55c4-c09b-250f-c1d71f031a8c@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=Chris.Redpath@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --cc=rafael@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).