From: Morten Rasmussen <morten.rasmussen@arm.com>
To: Steve Muckle <steve.muckle@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Juri Lelli <Juri.Lelli@arm.com>,
Patrick Bellasi <patrick.bellasi@arm.com>,
Steve Muckle <smuckle@linaro.org>
Subject: Re: [PATCH] sched: cpufreq: ignore SMT when determining max cpu capacity
Date: Wed, 24 Aug 2016 09:31:39 +0100 [thread overview]
Message-ID: <20160824083138.GA3315@e105550-lin.cambridge.arm.com> (raw)
In-Reply-To: <1471639427-16006-1-git-send-email-smuckle@linaro.org>
On Fri, Aug 19, 2016 at 01:43:47PM -0700, Steve Muckle wrote:
> PELT does not consider SMT when scaling its utilization values via
> arch_scale_cpu_capacity(). The value in rq->cpu_capacity_orig does
> take SMT into consideration though and therefore may be smaller than
> the utilization reported by PELT.
>
> On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
> util_avg scales up to 1024. This means that a 50% utilized CPU will show
> up in schedutil as ~86% busy.
>
> Fix this by using the same CPU scaling value in schedutil as that which
> is used by PELT.
>
> Signed-off-by: Steve Muckle <smuckle@linaro.org>
> ---
> kernel/sched/cpufreq_schedutil.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 60d985f4dc47..cb8a77b1ef1b 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -147,7 +147,9 @@ static unsigned int get_next_freq(struct sugov_cpu *sg_cpu, unsigned long util,
> static void sugov_get_util(unsigned long *util, unsigned long *max)
> {
> struct rq *rq = this_rq();
> - unsigned long cfs_max = rq->cpu_capacity_orig;
> + unsigned long cfs_max;
> +
> + cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
Until we have figured out how to define utilization (and capacity)
better for SMT I think this is a better solution.
Morten
prev parent reply other threads:[~2016-08-24 8:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 20:43 [PATCH] sched: cpufreq: ignore SMT when determining max cpu capacity Steve Muckle
2016-08-24 8:31 ` Morten Rasmussen [this message]
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=20160824083138.GA3315@e105550-lin.cambridge.arm.com \
--to=morten.rasmussen@arm.com \
--cc=Juri.Lelli@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=smuckle@linaro.org \
--cc=steve.muckle@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).