From: Christian Loehle <christian.loehle@arm.com>
To: Saravana Kannan <saravanak@google.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Benjamin Segall <bsegall@google.com>,
Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
wuyun.abel@bytedance.com, youssefesmat@chromium.org,
Thomas Gleixner <tglx@linutronix.de>,
efault@gmx.de, John Stultz <jstultz@google.com>,
Vincent Palomares <paillon@google.com>,
Tobias Huschle <huschle@linux.ibm.com>
Subject: Re: Very high scheduling delay with plenty of idle CPUs
Date: Mon, 11 Nov 2024 09:08:47 +0000 [thread overview]
Message-ID: <98fa6dc9-b7e1-4bc4-911a-2febc652e07d@arm.com> (raw)
In-Reply-To: <CAGETcx9ByrhRzpVo_5akoxx3NqjpxVHbPJrC-yq7xoYcb6+3qA@mail.gmail.com>
On 11/11/24 09:02, Saravana Kannan wrote:
> On Mon, Nov 11, 2024 at 12:25 AM Christian Loehle
> <christian.loehle@arm.com> wrote:
>>
>> On 11/11/24 06:15, Saravana Kannan wrote:
>> [...]
>>>>> Can we tell the scheduler to just spread out all the tasks during
>>>>> suspend/resume? Doesn't make a lot of sense to try and save power
>>>>> during a suspend/resume. It's almost always cheaper/better to do those
>>>>> quickly.
>>>>
>>>> That would increase the resume latency right since each runnable task
>>>> needs to go through a full idle CPU selection cycle? Isn't time a
>>>> consideration / concern in the resume path? Unless we go through the
>>>> slow path, it is very likely we'll end up making the same task
>>>> placement decisions again?
>>>
>>> I actually quickly hacked up the cpu_overutilized() function to return
>>> true during suspend/resume and the threads are nicely spread out and
>>> running in parallel. That actually reduces the total of the
>>> dpm_resume*() phases from 90ms to 75ms on my Pixel 6.
>>>
>>> Also, this whole email thread started because I'm optimizing the
>>> suspend/resume code to reduce a lot of sleeps/wakeups and the number
>>> of kworker threads. And with that + over utilization hack, resume time
>>> has dropped to 60ms.
>>>
>>> Peter,
>>>
>>> Would you be open to the scheduler being aware of
>>> dpm_suspend*()/dpm_resume*() phases and triggering the CPU
>>> overutilized behavior during these phases? I know it's a very use case
>>> specific behavior but how often do we NOT want to speed up
>>> suspend/resume? We can make this a CONFIG or a kernel command line
>>> option -- say, fast_suspend or something like that.
>>>
>>
>> Just to confirm, you essentially want to disable EAS during
>> suspend/resume, or does sis also not give you an acceptable
>> placement?
>
> If I effectively disable EAS during the dpm_resume/no_irq/early()
> phases (the past of the resume where devices are resumed and can run
> in parallel), that gives the best results. It shaves 15ms off.
>
> More important than disabling EAS, I think the main need is to not
> preempt a runnable thread or delay scheduling a runnable thread. But
> yes, effectively, all CPUs end up getting used because there's enough
> work to keep all the CPUs busy for 5ms. With the current behavior (is
> it solely because of EAS?), some of the 5ms runs get stacked in one
> CPU and it ends up taking 5ms longer. And this happens in multiple
> phases and bumps it up by 15ms today. And this is all data averaged
> over 100+ samples. So it's very clear cut data and not just noise.
"Is it only EAS?"
I would hope so, EAS should be responsible for all placement in your
case.
Right, but potential latency costs are a side-effect of co-scheduling,
so I'm not sure I understand why you'd rather make EAS work for this
specific use-case instead of just disabling it for phases we know
it can't do the best job?
The entire post-EEVDF discussions are all about "Some workloads like
preemption, other's don't", but as long as we have plenty of idle
CPUs all that seems like unnecessary effort, am I missing something?
Regards,
Christian
next prev parent reply other threads:[~2024-11-11 9:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 7:28 Very high scheduling delay with plenty of idle CPUs Saravana Kannan
2024-11-08 8:31 ` Peter Zijlstra
2024-11-10 5:49 ` Saravana Kannan
2024-11-11 5:17 ` K Prateek Nayak
2024-11-11 6:15 ` Saravana Kannan
2024-11-11 8:25 ` Christian Loehle
2024-11-11 9:02 ` Saravana Kannan
2024-11-11 9:08 ` Christian Loehle [this message]
2024-11-11 10:40 ` Peter Zijlstra
2024-11-11 11:15 ` Vincent Guittot
2024-11-11 18:17 ` Saravana Kannan
2024-11-11 19:00 ` Vincent Guittot
2024-11-11 18:23 ` Saravana Kannan
2024-11-11 19:01 ` Vincent Guittot
2024-11-11 19:12 ` Vincent Guittot
2024-11-12 7:23 ` Saravana Kannan
2024-11-12 9:03 ` Vincent Guittot
2024-11-12 16:25 ` Saravana Kannan
2024-11-12 17:00 ` Vincent Guittot
2024-11-08 9:02 ` Vincent Guittot
2024-11-14 6:36 ` Saravana Kannan
2024-11-14 13:06 ` Vincent Guittot
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=98fa6dc9-b7e1-4bc4-911a-2febc652e07d@arm.com \
--to=christian.loehle@arm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=efault@gmx.de \
--cc=huschle@linux.ibm.com \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=paillon@google.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=saravanak@google.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wuyun.abel@bytedance.com \
--cc=youssefesmat@chromium.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