From: Saravana Kannan <skannan@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lucas Stach <l.stach@pengutronix.de>,
Rafael Wysocki <rjw@rjwysocki.net>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
ke.wang@spreadtrum.com, linaro-kernel@lists.linaro.org,
linux-pm@vger.kernel.org, ego@linux.vnet.ibm.com,
paulus@samba.org, shilpa.bhat@linux.vnet.ibm.com,
prarit@redhat.com, robert.schoene@tu-dresden.de
Subject: Re: [PATCH V2 06/10] cpufreq: governor: Keep single copy of information common to policy->cpus
Date: Wed, 02 Dec 2015 13:43:59 -0800 [thread overview]
Message-ID: <565F661F.1020204@codeaurora.org> (raw)
In-Reply-To: <20151130110327.GC4899@ubuntu>
On 11/30/2015 03:03 AM, Viresh Kumar wrote:
> On 30-11-15, 11:34, Lucas Stach wrote:
>> The timer_mutex is one of the top contended locks already on a quad core
>> system.
>
> My new series (un-committed) should fix that to some level hopefully:
>
> http://marc.info/?l=linux-pm&m=144612165211091&w=2
>
>> That really doesn't look right, as the timer is quite low
>> frequency. It's causing excessive wake ups, as all 4 CPUs wake up to
>> handle the WQ, 3 of them directly go back to sleep waiting for the mutex
>> to be released, then same thing happens for CPUs-1 until we rippled down
>> to a single CPU.
>
> There is a reason why we need to do this on all CPUs today. The timers
> are deferrable by nature, as we shouldn't wake up a CPU to change it
> frequency. Now group of CPUs that change their DVFS state together, or
> that change their voltage/clock rails are part of the same
> cpufreq-policy. We need to take load of all the CPUs, that are part of
> the policy, while update the frequency of the group.
>
> If we queue the timer on any one CPU, then that CPU can go into idle
> and the deferred timer will not fire. But the other CPUs of the policy
> can still be active and the frequency of the group wouldn't change
> with load.
>
> Hope that answers the query related to timers on all CPUs.
>
>> I would say it's still worth fixing. Perhaps by not waking all the
>> workqueues at the same time, but spreading the wake times out over a
>> jiffy.
>
> Maybe.
>
There's a separate thread where we proposed a fix to deferrable timers
that are stored globally if they are not CPU bound. That way, even if
one CPU is up, they get handled. But TGLX had some valid concerns with
cache thrashing and impact on some network code. So, last I heard, he
was going to rewrite and fixed the deferrable timer problem by having
the "orphaned" (because CPU has gone idle) deferrable timers being
adopted by other CPUs while the original CPU is idle.
Once that's fixed, we just need one timer per policy. Long story short,
CPU freq is working around a poor API semantic of deferrable timers.
-Saravana
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-12-02 21:44 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 11:48 [PATCH V2 00/10] cpufreq: governor: Avoid invalid state-transitions Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 01/10] cpufreq: governor: Name delayed-work as dwork Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 02/10] cpufreq: governor: Drop unused field 'cpu' Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 03/10] cpufreq: governor: Rename 'cpu_dbs_common_info' to 'cpu_dbs_info' Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 04/10] cpufreq: governor: name pointer to cpu_dbs_info as 'cdbs' Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 05/10] cpufreq: governor: rename cur_policy as policy Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 06/10] cpufreq: governor: Keep single copy of information common to policy->cpus Viresh Kumar
2015-07-17 22:11 ` Rafael J. Wysocki
2015-11-27 11:56 ` Lucas Stach
2015-11-30 5:19 ` Viresh Kumar
2015-11-30 10:34 ` Lucas Stach
2015-11-30 11:03 ` Viresh Kumar
2015-12-02 21:43 ` Saravana Kannan [this message]
2015-12-03 4:54 ` Viresh Kumar
2015-12-03 6:53 ` Robert Schöne
2015-12-03 22:00 ` Saravana Kannan
2015-06-19 11:48 ` [PATCH V2 07/10] cpufreq: governor: split out common part of {cs|od}_dbs_timer() Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 08/10] cpufreq: governor: Avoid invalid states with additional checks Viresh Kumar
2015-06-19 18:04 ` Preeti U Murthy
2015-06-19 11:48 ` [PATCH V2 09/10] cpufreq: governor: Don't WARN on invalid states Viresh Kumar
2015-06-19 11:48 ` [PATCH V2 10/10] cpufreq: propagate errors returned from __cpufreq_governor() Viresh Kumar
2015-06-19 18:02 ` Preeti U Murthy
2015-06-20 3:12 ` Viresh Kumar
2015-06-22 4:41 ` Preeti U Murthy
2015-06-22 5:21 ` Viresh Kumar
2015-06-19 18:09 ` Preeti U Murthy
2015-06-19 18:08 ` [PATCH V2 00/10] cpufreq: governor: Avoid invalid state-transitions Preeti U Murthy
2015-06-19 23:16 ` Rafael J. Wysocki
2015-06-20 2:36 ` Viresh Kumar
2015-07-17 22:15 ` Rafael J. Wysocki
2015-07-18 6:00 ` [PATCH V3 0/5] " Viresh Kumar
2015-07-18 6:00 ` [PATCH V3 1/5] cpufreq: governor: Keep single copy of information common to policy->cpus Viresh Kumar
2015-07-18 6:01 ` [PATCH V3 2/5] cpufreq: governor: split out common part of {cs|od}_dbs_timer() Viresh Kumar
2015-07-18 6:01 ` [PATCH V3 3/5] cpufreq: governor: Avoid invalid states with additional checks Viresh Kumar
2015-07-18 6:01 ` [PATCH V3 4/5] cpufreq: governor: Don't WARN on invalid states Viresh Kumar
2015-07-18 6:01 ` [PATCH V3 5/5] cpufreq: propagate errors returned from __cpufreq_governor() Viresh Kumar
2015-07-23 21:00 ` [PATCH V3 0/5] cpufreq: governor: Avoid invalid state-transitions 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=565F661F.1020204@codeaurora.org \
--to=skannan@codeaurora.org \
--cc=ego@linux.vnet.ibm.com \
--cc=ke.wang@spreadtrum.com \
--cc=l.stach@pengutronix.de \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=paulus@samba.org \
--cc=prarit@redhat.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=rjw@rjwysocki.net \
--cc=robert.schoene@tu-dresden.de \
--cc=shilpa.bhat@linux.vnet.ibm.com \
--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).