From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Francisco Jerez <currojerez@riseup.net>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Linux Documentation <linux-doc@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Giovanni Gherdovich <ggherdovich@suse.cz>,
Doug Smythies <dsmythies@telus.net>
Subject: Re: [PATCH] cpufreq: intel_pstate: Implement passive mode with HWP enabled
Date: Tue, 28 Jul 2020 17:41:42 +0200 [thread overview]
Message-ID: <1884886.tmXHBG24oC@kreacher> (raw)
In-Reply-To: <87mu3thiz5.fsf@riseup.net>
On Tuesday, July 21, 2020 1:20:14 AM CEST Francisco Jerez wrote:
>
[cut]
> > If there is a bug, then what exactly is it, from the users' perspective?
> >
>
> It can be reproduced easily as follows:
>
> | echo 1 > /sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost
> | for p in /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference; do echo performance > $p; done
>
> Let's make sure that the EPP updates landed on the turbostat output:
>
> |[..]
> | Core CPU Avg_MHz Busy% Bzy_MHz HWP_REQ
> | - - 1 0.05 2396 0x0000000000000000
> | 0 0 1 0.05 2153 0x0000000000002704
> | 0 4 1 0.04 2062 0x0000000000002704
> | 1 1 1 0.02 2938 0x0000000000002704
> | 1 5 2 0.09 2609 0x0000000000002704
> | 2 2 1 0.04 1857 0x0000000000002704
> | 2 6 1 0.05 2561 0x0000000000002704
> | 3 3 0 0.01 1883 0x0000000000002704
> | 3 7 2 0.07 2703 0x0000000000002704
> |[..]
>
> Now let's do some non-trivial IO activity in order to trigger HWP
> dynamic boost, and watch while random CPUs start losing their EPP
> setting requested via sysfs:
>
> |[..]
> | Core CPU Avg_MHz Busy% Bzy_MHz HWP_REQ
> | - - 16 0.81 2023 0x0000000000000000
> | 0 0 7 0.66 1069 0x0000000080002704
> ^^
> | 0 4 24 2.19 1116 0x0000000080002704
> ^^
> | 1 1 18 0.68 2618 0x0000000000002704
> | 1 5 1 0.03 2005 0x0000000000002704
> | 2 2 2 0.07 2512 0x0000000000002704
> | 2 6 33 1.35 2402 0x0000000000002704
> | 3 3 1 0.04 2470 0x0000000000002704
> | 3 7 45 1.42 3185 0x0000000080002704
> ^^
Actually, that's because intel_pstate_hwp_boost_up() and
intel_pstate_hwp_boost_down() use the hwp_req_cached value
for updating the HWP Request MSR and that is only written to
by intel_pstate_hwp_set() which is only invoked on policy changes,
so the MSR writes from intel_pstate_set_energy_pref_index()
basically get discarded.
So this is a matter of synchronizing intel_pstate_set_policy() with
intel_pstate_set_energy_pref_index() and they both acquire
intel_pstate_limits_lock already, so this shouldn't be too difficult to fix.
Let me cut a patch for that.
next prev parent reply other threads:[~2020-07-28 15:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 18:16 [PATCH] cpufreq: intel_pstate: Implement passive mode with HWP enabled Rafael J. Wysocki
2020-07-15 0:09 ` Francisco Jerez
2020-07-15 12:04 ` Rafael J. Wysocki
2020-07-15 21:35 ` Francisco Jerez
2020-07-16 1:14 ` Srinivas Pandruvada
2020-07-16 14:33 ` Rafael J. Wysocki
2020-07-16 14:32 ` Rafael J. Wysocki
2020-07-17 0:21 ` Francisco Jerez
2020-07-19 19:06 ` Rafael J. Wysocki
2020-07-20 23:20 ` Francisco Jerez
2020-07-21 16:25 ` Srinivas Pandruvada
2020-07-21 23:14 ` Francisco Jerez
2020-07-27 17:23 ` Rafael J. Wysocki
2020-07-27 17:15 ` Rafael J. Wysocki
2020-07-28 2:32 ` Francisco Jerez
2020-07-28 18:27 ` Rafael J. Wysocki
2020-07-29 5:46 ` Francisco Jerez
2020-07-29 17:52 ` Rafael J. Wysocki
2020-07-30 0:49 ` Francisco Jerez
2020-07-31 17:52 ` Rafael J. Wysocki
2020-07-31 22:43 ` Francisco Jerez
2020-07-28 15:41 ` Rafael J. Wysocki [this message]
2020-07-15 20:39 ` Doug Smythies
2020-07-16 12:07 ` Rafael J. Wysocki
2020-07-17 13:37 ` Doug Smythies
2020-07-19 11:42 ` Rafael J. Wysocki
2020-08-02 15:17 ` Doug Smythies
2020-08-03 17:08 ` Rafael J. Wysocki
2020-08-06 5:54 ` Doug Smythies
2020-08-06 11:39 ` 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=1884886.tmXHBG24oC@kreacher \
--to=rjw@rjwysocki.net \
--cc=currojerez@riseup.net \
--cc=dsmythies@telus.net \
--cc=ggherdovich@suse.cz \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/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).