From: Qais Yousef <qyousef@layalina.io>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Christian Loehle <christian.loehle@arm.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Juri Lelli <juri.lelli@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Hongyan Xia <hongyan.xia2@arm.com>,
John Stultz <jstultz@google.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7] sched: Consolidate cpufreq updates
Date: Sun, 9 Feb 2025 22:34:33 +0000 [thread overview]
Message-ID: <20250209223433.symtjwbkcbwvhlc7@airbuntu> (raw)
In-Reply-To: <CAJZ5v0ieB4hppC8fHnjhNNpfFZzEL4Y96irSTmCmavXCid2xtA@mail.gmail.com>
On 09/12/24 13:33, Rafael J. Wysocki wrote:
> On Wed, Sep 11, 2024 at 10:34 PM Christian Loehle
> <christian.loehle@arm.com> wrote:
> >
> > On 7/28/24 19:45, Qais Yousef wrote:
> > > Improve the interaction with cpufreq governors by making the
> > > cpufreq_update_util() calls more intentional.
> > >
> > > At the moment we send them when load is updated for CFS, bandwidth for
> > > DL and at enqueue/dequeue for RT. But this can lead to too many updates
> > > sent in a short period of time and potentially be ignored at a critical
> > > moment due to the rate_limit_us in schedutil.
> > >
> > > For example, simultaneous task enqueue on the CPU where 2nd task is
> > > bigger and requires higher freq. The trigger to cpufreq_update_util() by
> > > the first task will lead to dropping the 2nd request until tick. Or
> > > another CPU in the same policy triggers a freq update shortly after.
> > >
> > > Updates at enqueue for RT are not strictly required. Though they do help
> > > to reduce the delay for switching the frequency and the potential
> > > observation of lower frequency during this delay. But current logic
> > > doesn't intentionally (at least to my understanding) try to speed up the
> > > request.
> > >
> > > To help reduce the amount of cpufreq updates and make them more
> > > purposeful, consolidate them into these locations:
> > >
> > > 1. context_switch()
> > > 2. task_tick_fair()
> > > 3. sched_balance_update_blocked_averages()
> > > 4. on sched_setscheduler() syscall that changes policy or uclamp values
> > > 5. on check_preempt_wakeup_fair() if wakeup preemption failed
> > > 6. on __add_running_bw() to guarantee DL bandwidth requirements.
> > >
> >
> > Actually now reading that code again reminded me, there is another
> > iowait boost change for intel_pstate.
> > intel_pstate has either intel_pstate_update_util() or
> > intel_pstate_update_util_hwp().
> > Both have
> > if (smp_processor_id() != cpu->cpu)
> > return;
> > Now since we move that update from enqueue to context_switch() that will
> > always be false.
> > I don't think that was deliberate but rather to simplify intel_pstate
> > synchronization, although !mcq device IO won't be boosted which you
> > could argue is good.
> > Just wanted to mention that, doesn't have to be a bad, but surely some
> > behavior change.
>
> This particular change shouldn't be problematic.
Thanks for checking and sorry for delayed response. Life got in the way and
couldn't get back to this sooner.
Cheers
--
Qais Yousef
next prev parent reply other threads:[~2025-02-09 22:34 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 18:45 [PATCH v7] sched: Consolidate cpufreq updates Qais Yousef
2024-07-29 16:01 ` Metin Kaya
2024-08-01 12:22 ` Qais Yousef
2024-08-05 15:35 ` Christian Loehle
2024-08-09 1:13 ` Qais Yousef
2024-08-13 8:25 ` Vincent Guittot
2024-08-13 8:27 ` Vincent Guittot
2024-08-13 16:26 ` Christian Loehle
2024-08-13 16:43 ` Vincent Guittot
2024-08-13 16:56 ` Christian Loehle
2024-09-01 17:51 ` Qais Yousef
2024-09-02 12:30 ` Vincent Guittot
2024-09-02 12:35 ` Christian Loehle
2024-09-02 12:43 ` Vincent Guittot
2024-09-02 12:58 ` Qais Yousef
2024-09-02 13:34 ` Qais Yousef
2024-09-02 13:40 ` Christian Loehle
2024-09-02 13:36 ` Vincent Guittot
2024-09-02 20:43 ` Qais Yousef
2024-09-03 6:54 ` Vincent Guittot
2024-08-13 10:02 ` Vincent Guittot
2024-09-01 18:01 ` Qais Yousef
2024-09-03 12:48 ` Vincent Guittot
2024-09-11 20:34 ` Christian Loehle
2024-09-12 11:33 ` Rafael J. Wysocki
2025-02-09 22:34 ` Qais Yousef [this message]
2024-10-07 17:20 ` Anjali K
2024-10-08 9:56 ` Christian Loehle
2024-10-10 18:32 ` Christian Loehle
2024-10-18 18:32 ` Anjali K
2024-11-25 6:32 ` Anjali K
2025-02-09 22:33 ` Qais Yousef
2024-10-11 9:34 ` Christian Loehle
2025-02-09 22:41 ` 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=20250209223433.symtjwbkcbwvhlc7@airbuntu \
--to=qyousef@layalina.io \
--cc=bsegall@google.com \
--cc=christian.loehle@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=hongyan.xia2@arm.com \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vschneid@redhat.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