From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Joel Fernandes <joelaf@google.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux PM <linux-pm@vger.kernel.org>,
Juri Lelli <juri.lelli@arm.com>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Patrick Bellasi <patrick.bellasi@arm.com>,
Morten Rasmussen <morten.rasmussen@arm.com>
Subject: Re: [RFC/RFT][PATCH 2/2] cpufreq: schedutil: Utilization aggregation
Date: Mon, 10 Apr 2017 22:59:16 +0200 [thread overview]
Message-ID: <CAJZ5v0gePrW+hnR4UdGnxuibhcUvcfHSfULFok3tYEsOvD7eLA@mail.gmail.com> (raw)
In-Reply-To: <CAJWu+orhpeirhB1u-KTOBjWTQoTEJdStR3BP14WxkB=RZP49sg@mail.gmail.com>
On Mon, Apr 10, 2017 at 8:39 AM, Joel Fernandes <joelaf@google.com> wrote:
> Hi Rafael,
Hi,
> On Sun, Apr 9, 2017 at 5:11 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
[cut]
>> @@ -154,22 +153,30 @@ static unsigned int get_next_freq(struct
>> return cpufreq_driver_resolve_freq(policy, freq);
>> }
>>
>> -static void sugov_get_util(unsigned long *util, unsigned long *max)
>> +static void sugov_get_util(struct sugov_cpu *sg_cpu, unsigned int flags)
>> {
>> + unsigned long cfs_util, cfs_max;
>> struct rq *rq = this_rq();
>> - unsigned long cfs_max;
>>
>> - cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
>> + sg_cpu->flags |= flags & SCHED_CPUFREQ_RT_DL;
>> + if (sg_cpu->flags & SCHED_CPUFREQ_RT_DL)
>> + return;
>>
>> - *util = min(rq->cfs.avg.util_avg, cfs_max);
>> - *max = cfs_max;
>> + cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
>> + cfs_util = min(rq->cfs.avg.util_avg, cfs_max);
>> + if (sg_cpu->util * cfs_max < sg_cpu->max * cfs_util) {
>
> Assuming all CPUs have equal compute capacity, doesn't this mean that
> sg_cpu->util is updated only if cfs_util > sg_cpu->util?
Yes, it does.
> Maybe I missed something, but wouldn't we want sg_cpu->util to be
> reduced as well when cfs_util reduces? Doesn't this condition
> basically discard all updates to sg_cpu->util that could have reduced
> it?
>
>> + sg_cpu->util = cfs_util;
>> + sg_cpu->max = cfs_max;
>> + }
>> }
Well, that's the idea. :-)
During the discussion at the OSPM-summit we concluded that discarding
all of the utilization changes between the points at which frequency
updates actually happened was not a good idea, so they needed to be
aggregated somehow.
There are a few ways to aggregate them, but the most straightforward
one (and one which actually makes sense) is to take the maximum as the
aggregate value.
Of course, this means that we skew things towards performance here,
but I'm not worried that much. :-)
Thanks,
Rafael
next prev parent reply other threads:[~2017-04-10 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 0:07 [RFC/RFT][PATCH 0/2] cpufreq: schedutil: Updates related to the rate limit Rafael J. Wysocki
2017-04-10 0:10 ` [RFC/RFT][PATCH 1/2] cpufreq: schedutil: Use policy-dependent latency multupliers Rafael J. Wysocki
2017-04-10 10:38 ` Brendan Jackman
2017-04-10 11:03 ` Rafael J. Wysocki
2017-04-10 22:20 ` [RFC/RFT][PATCH 1/2] cpufreq: schedutil: Use policy-dependent transition delays Rafael J. Wysocki
2017-04-11 11:14 ` Viresh Kumar
2017-04-11 14:01 ` Rafael J. Wysocki
2017-04-14 22:51 ` Rafael J. Wysocki
2017-04-15 2:23 ` Joel Fernandes
2017-04-18 9:43 ` Brendan Jackman
2017-04-17 5:41 ` Viresh Kumar
2017-04-10 0:11 ` [RFC/RFT][PATCH 2/2] cpufreq: schedutil: Utilization aggregation Rafael J. Wysocki
2017-04-10 6:39 ` Joel Fernandes
2017-04-10 20:59 ` Rafael J. Wysocki [this message]
2017-04-11 1:57 ` Joel Fernandes
2017-04-11 20:53 ` Rafael J. Wysocki
2017-04-10 11:26 ` Juri Lelli
2017-04-10 21:13 ` Rafael J. Wysocki
2017-04-11 7:00 ` Juri Lelli
2017-04-11 21:03 ` Rafael J. Wysocki
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=CAJZ5v0gePrW+hnR4UdGnxuibhcUvcfHSfULFok3tYEsOvD7eLA@mail.gmail.com \
--to=rafael@kernel.org \
--cc=joelaf@google.com \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--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).