From: Jisheng Zhang <jszhang@marvell.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Srinivas Pandruvada" <srinivas.pandruvada@intel.com>
Subject: Re: regression caused by bb6ab52f2bef ("intel_pstate: Do not set utilization update hook too early")
Date: Mon, 27 Jun 2016 14:08:58 +0800 [thread overview]
Message-ID: <20160627140858.0c7686f0@xhacker> (raw)
In-Reply-To: <2958182.eDEME9b2CX@vostro.rjw.lan>
Dear Rafael,
On Sat, 25 Jun 2016 02:14:28 +0200 "Rafael J. Wysocki" wrote:
> On Friday, June 17, 2016 04:09:33 PM Jisheng Zhang wrote:
> > Dear all,
> >
> > If using acpi-cpufreq instead, v4.6, v4.6-rc3, v4.7-rc3 can't reproduce the issue. It seems
> > only intel_pstate is impacted.
>
> Which is quite obvious, since the commit your bisection led to was
> intel_pstate-specific. :-)
>
> If the issue is what I'm thinking it is, the patch below should help, so
> can you please test it?
>
> Thanks,
> Rafael
>
> ---
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Subject: [PATCH] intel_pstate: Do not clear utilization update hooks on policy changes
>
> intel_pstate_set_policy() is invoked by the cpufreq core during
> driver initialization, on changes of policy attributes (minimim and
> maximum frequency, for example) via sysfs and via CPU notifications
> from the platform firmware. On some platforms the latter may occur
> relatively often.
>
> Commit bb6ab52f2bef (intel_pstate: Do not set utilization update hook
> too early) made intel_pstate_set_policy() clear the CPU's utilization
> update hook before updating the policy attributes for it (and set the
> hook again after doind that), but that involves invoking
> synchronize_sched() and adds overhead to the CPU notifications
> mentioned above and to the sched-RCU handling in general.
>
> That extra overhead is arguably not necessary, because updating
> policy attributes when the CPU's utilization update hook is active
> should not lead to any adverse effects, so drop the clearing of
> the hook from intel_pstate_set_policy() and make it check if
> the hook has been set already when attempting to set it.
This patch works!
on a 32 snb cores server:
80 wakeups/s w/o the patch
7 wakeups/s w/ the patch
on a 4 snb cores laptop:
22 wakeups/s w/o the patch
6 wakeups/s w/ the patch
Thank you so much for fixing it ;)
>
> Fixes: bb6ab52f2bef (intel_pstate: Do not set utilization update hook too early)
> Reported-by: Jisheng Zhang <jszhang@marvell.com>
So feel free to add
Tested-by: Jisheng Zhang <jszhang@marvell.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/cpufreq/intel_pstate.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/intel_pstate.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/intel_pstate.c
> +++ linux-pm/drivers/cpufreq/intel_pstate.c
> @@ -1440,6 +1440,9 @@ static void intel_pstate_set_update_util
> {
> struct cpudata *cpu = all_cpu_data[cpu_num];
>
> + if (cpu->update_util_set)
> + return;
> +
> /* Prevent intel_pstate_update_util() from using stale data. */
> cpu->sample.time = 0;
> cpufreq_add_update_util_hook(cpu_num, &cpu->update_util,
> @@ -1480,8 +1483,6 @@ static int intel_pstate_set_policy(struc
> if (!policy->cpuinfo.max_freq)
> return -ENODEV;
>
> - intel_pstate_clear_update_util_hook(policy->cpu);
> -
> pr_debug("set_policy cpuinfo.max %u policy->max %u\n",
> policy->cpuinfo.max_freq, policy->max);
>
>
next prev parent reply other threads:[~2016-06-27 6:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 8:30 regression caused by 08f511fd41c3 ("cpufreq: Reduce cpufreq_update_util() overhead a bit") Jisheng Zhang
2016-06-17 8:40 ` Jisheng Zhang
2016-06-17 13:09 ` Rafael J. Wysocki
2016-06-17 13:16 ` Paul E. McKenney
2016-06-17 14:03 ` Peter Zijlstra
2016-06-17 15:32 ` regression caused by bb6ab52f2bef ("intel_pstate: Do not set utilization update hook too early") Jisheng Zhang
2016-06-17 15:40 ` Rafael J. Wysocki
2016-06-17 15:42 ` Rafael J. Wysocki
2016-06-17 15:53 ` Jisheng Zhang
2016-06-17 16:09 ` Jisheng Zhang
2016-06-25 0:14 ` Rafael J. Wysocki
2016-06-25 15:09 ` Pandruvada, Srinivas
2016-06-26 0:27 ` Doug Smythies
2016-06-27 6:08 ` Jisheng Zhang [this message]
2016-06-23 16:07 ` Doug Smythies
2016-06-25 0:03 ` Rafael J. Wysocki
2016-06-17 15:32 ` regression caused by 08f511fd41c3 ("cpufreq: Reduce cpufreq_update_util() overhead a bit") 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=20160627140858.0c7686f0@xhacker \
--to=jszhang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@intel.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).