From: Peter Zijlstra <peterz@infradead.org>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Qais Yousef <qyousef@layalina.io>,
Kajetan Puchalski <kajetan.puchalski@arm.com>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Vincent Donnefort <vdonnefort@google.com>,
Quentin Perret <qperret@google.com>,
Abhijeet Dharmapurikar <adharmap@quicinc.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] sched/fair, cpufreq: Introduce 'runnable boosting'
Date: Fri, 12 May 2023 13:22:29 +0200 [thread overview]
Message-ID: <20230512112229.GW4253@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230512101029.342823-3-dietmar.eggemann@arm.com>
On Fri, May 12, 2023 at 12:10:29PM +0200, Dietmar Eggemann wrote:
> -static unsigned long cpu_util(int cpu, struct task_struct *p, int dst_cpu)
> +static unsigned long
> +cpu_util(int cpu, struct task_struct *p, int dst_cpu, int boost)
> {
> struct cfs_rq *cfs_rq = &cpu_rq(cpu)->cfs;
> unsigned long util = READ_ONCE(cfs_rq->avg.util_avg);
> + unsigned long runnable;
> +
> + runnable = boost ? READ_ONCE(cfs_rq->avg.runnable_avg) : 0;
> + util = max(util, runnable);
>
if (boost)
util = max(util, READ_ONCE(cfs_rq->avg.runnable_avg));
> @@ -7239,9 +7246,9 @@ static unsigned long cpu_util(int cpu, struct task_struct *p, int dst_cpu)
> *
> * Return: (Estimated) utilization for the specified CPU.
> */
Given that cpu_util() is the base function should this comment move
there?
> -unsigned long cpu_util_cfs(int cpu)
> +unsigned long cpu_util_cfs(int cpu, int boost)
> {
> - return cpu_util(cpu, NULL, -1);
> + return cpu_util(cpu, NULL, -1, boost);
> }
AFAICT the @boost argument is always a constant (0 or 1). Would it not
make more sense to simply add:
unsigned long cpu_util_cfs_boost(int cpu)
{
return cpu_util(cpu, NULL, -1, 1);
}
and use that in the few sites that actually need it?
next prev parent reply other threads:[~2023-05-12 11:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 10:10 [PATCH v2 0/2] sched: Consider CPU contention in frequency, EAS max util & load-balance busiest CPU selection Dietmar Eggemann
2023-05-12 10:10 ` [PATCH v2 1/2] sched/fair: Refactor CPU utilization functions Dietmar Eggemann
2023-05-12 10:10 ` [PATCH v2 2/2] sched/fair, cpufreq: Introduce 'runnable boosting' Dietmar Eggemann
2023-05-12 11:22 ` Peter Zijlstra [this message]
2023-05-12 14:39 ` Dietmar Eggemann
2023-05-13 9:32 ` Peter Zijlstra
2023-05-12 11:32 ` Peter Zijlstra
2023-05-12 14:39 ` Dietmar Eggemann
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=20230512112229.GW4253@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=adharmap@quicinc.com \
--cc=dietmar.eggemann@arm.com \
--cc=kajetan.puchalski@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=qperret@google.com \
--cc=qyousef@layalina.io \
--cc=vdonnefort@google.com \
--cc=vincent.guittot@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