From: Vikram Mulukutla <markivx@codeaurora.org>
To: Joel Fernandes <joelaf@google.com>
Cc: Patrick Bellasi <patrick.bellasi@arm.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Juri Lelli <juri.lelli@arm.com>,
Andres Oportus <andresoportus@google.com>,
Todd Kjos <tkjos@android.com>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
linux-kernel-owner@vger.kernel.org
Subject: Re: [PATCH v2 4/6] cpufreq: schedutil: update CFS util only if used
Date: Mon, 10 Jul 2017 10:49:39 -0700 [thread overview]
Message-ID: <aede676e7d75a4cf6cffb7f8953b9943@codeaurora.org> (raw)
In-Reply-To: <CAJWu+opqoBzYr7fZJQ5RP=72ci6xKsh2Jes0GJe_L1x8dZW+dA@mail.gmail.com>
On 2017-07-07 23:14, Joel Fernandes wrote:
> Hi Vikram,
>
> On Thu, Jul 6, 2017 at 11:44 PM, Vikram Mulukutla
> <markivx@codeaurora.org> wrote:
>> On 2017-07-04 10:34, Patrick Bellasi wrote:
>>>
>>> Currently the utilization of the FAIR class is collected before
>>> locking
>>> the policy. Although that should not be a big issue for most cases,
>>> we
>>> also don't really know how much latency there can be between the
>>> utilization reading and its usage.
>>>
>>> Let's get the FAIR utilization right before its usage to be better in
>>> sync with the current status of a CPU.
>>>
>>> Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
<snip>
>> Given that the utilization update hooks are called with the per-cpu rq
>> lock
>> held (for all classes), I don't think PELT utilization can change
>> throughout
>> the lifetime of the cpufreq_update_{util,this_cpu} call? Even with
>> Viresh's
>> remote cpu callback series we'd still have to hold the rq lock across
>> cpufreq_update_util.. what can change today is 'max'
>> (arch_scale_cpu_capacity) when a cpufreq policy is shared, so the
>> patch is
>> still needed for that reason I think?
>>
>
> I didn't follow, Could you elaborate more why you think the patch
> helps with the case where max changes while the per-cpu rq lock held?
>
So going by Patrick's commit text, the concern was a TOC/TOU
problem, but since we agree that CFS utilization can't change
within an rq-locked critical section, the only thing that can
change is 'max'. So you might be the 8th cpu in line waiting
for the sg-policy lock, and after you get the lock, the max may
be outdated.
But come to think of it max changes should be triggering schedutil
updates and those shouldn't be rate-throttled, so maybe we don't
need this at all? It's still somewhat future-proof in case there
is some stat that we read in sugov_get_util that can be updated
asynchronously. However we can put it in when we need it...
> thanks,
>
> -Joel
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-07-10 17:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 17:34 [PATCH v2 0/6] cpufreq: schedutil: fixes for flags updates Patrick Bellasi
2017-07-04 17:34 ` [PATCH v2 1/6] cpufreq: schedutil: ignore sugov kthreads Patrick Bellasi
2017-07-05 5:00 ` Viresh Kumar
2017-07-05 11:38 ` Patrick Bellasi
2017-07-06 4:50 ` Viresh Kumar
2017-07-06 22:18 ` Rafael J. Wysocki
2017-07-11 19:08 ` Saravana Kannan
2017-07-04 17:34 ` [PATCH v2 2/6] cpufreq: schedutil: reset sg_cpus's flags at IDLE enter Patrick Bellasi
2017-07-05 4:50 ` Viresh Kumar
2017-07-05 13:04 ` Patrick Bellasi
2017-07-06 5:46 ` Viresh Kumar
2017-07-07 4:43 ` Joel Fernandes
2017-07-07 10:17 ` Juri Lelli
2017-07-11 19:16 ` Saravana Kannan
2017-07-04 17:34 ` [PATCH v2 3/6] cpufreq: schedutil: ensure max frequency while running RT/DL tasks Patrick Bellasi
2017-07-05 6:01 ` Viresh Kumar
2017-07-05 13:41 ` Patrick Bellasi
2017-07-06 5:56 ` Viresh Kumar
2017-07-07 5:26 ` Joel Fernandes
2017-07-04 17:34 ` [PATCH v2 4/6] cpufreq: schedutil: update CFS util only if used Patrick Bellasi
2017-07-07 5:58 ` Joel Fernandes
2017-07-07 6:44 ` Vikram Mulukutla
2017-07-08 6:14 ` Joel Fernandes
2017-07-10 17:49 ` Vikram Mulukutla [this message]
2017-07-11 5:19 ` Joel Fernandes
2017-07-04 17:34 ` [PATCH v2 5/6] sched/rt: fast switch to maximum frequency when RT tasks are scheduled Patrick Bellasi
2017-07-04 17:34 ` [PATCH v2 6/6] cpufreq: schedutil: relax rate-limiting while running RT/DL tasks Patrick Bellasi
2017-07-06 22:26 ` [PATCH v2 0/6] cpufreq: schedutil: fixes for flags updates 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=aede676e7d75a4cf6cffb7f8953b9943@codeaurora.org \
--to=markivx@codeaurora.org \
--cc=andresoportus@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=joelaf@google.com \
--cc=juri.lelli@arm.com \
--cc=linux-kernel-owner@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tkjos@android.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).