Linux Power Management development
 help / color / mirror / Atom feed
From: Russell Haley <yumpusamongus@gmail.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Shashank Balaji <shashank.mahadasyam@sony.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-pm@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Shinya Takumi <shinya.takumi@sony.com>
Subject: Re: [PATCH] cpufreq, docs: (userspace governor) add that actual freq is >= scaling_setspeed
Date: Thu, 22 May 2025 06:15:24 -0500	[thread overview]
Message-ID: <b62c0462-8185-4eb8-8ac6-7f2abc387768@gmail.com> (raw)
In-Reply-To: <CAJZ5v0gz3Y+RGqBf9E1hzq9rwfrryd98Xpk51DtLd-uck5y-rw@mail.gmail.com>



On 5/22/25 4:47 AM, Rafael J. Wysocki wrote:
> On Thu, May 22, 2025 at 10:51 AM Russell Haley <yumpusamongus@gmail.com> wrote:
>>
>>
>> On 5/22/25 3:05 AM, Shashank Balaji wrote:
>>> The userspace governor does not have the CPUFREQ_GOV_STRICT_TARGET flag, which
>>> means the requested frequency may not strictly be followed. This is true in the
>>> case of the intel_pstate driver with HWP enabled. When programming the
>>> HWP_REQUEST MSR, the min_perf is set to `scaling_setspeed`, and the max_perf
>>> is set to the policy's max. So, the hardware is free to increase the frequency
>>> beyond the requested frequency.
>>>
>>> This behaviour can be slightly surprising, given the current wording "allows
>>> userspace to set the CPU frequency". Hence, document this.
>>>
>>
>> In my opinion, the documentation is correct, and it is the
>> implementation in intel_pstate that is wrong. If the user wanted two
>> separate knobs that control the minimum and maximum frequencies, they
>> could leave intel_pstate in "active" mode and change scaling_min_freq
>> and scaling_max_freq.
>>
>> If the user asks for the frequency to be set from userspace, the
>> frequency had damn well better be set from userspace.
> 
> The userspace governor requests a frequency between policy->min and
> policy->max on behalf of user space.  In intel_pstate this translates
> to setting DESIRED_PERF to the requested value which is also the case
> for the other governors.

Huh.  On this Skylake box with kernel 6.14.6, it seems to be setting
Minimum_Performance, and leaving desired at 0.

> echo userspace | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
userspace
> echo 1400000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed
1400000
> sudo x86_energy_perf_policy &| grep REQ
cpu0: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu1: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu2: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu3: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu4: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu5: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu6: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0
cpu7: HWP_REQ: min 14 max 40 des 0 epp 128 window 0x0 (0*10^0us) use_pkg 0

Cheers,
Russell

  reply	other threads:[~2025-05-22 11:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22  8:05 [PATCH] cpufreq, docs: (userspace governor) add that actual freq is >= scaling_setspeed Shashank Balaji
2025-05-22  8:50 ` Russell Haley
2025-05-22  9:46   ` Shashank Balaji
2025-05-22  9:56     ` Rafael J. Wysocki
2025-05-22 11:15     ` Russell Haley
2025-05-22  9:47   ` Rafael J. Wysocki
2025-05-22 11:15     ` Russell Haley [this message]
2025-05-22 11:54       ` Rafael J. Wysocki
2025-05-23 18:57         ` Rafael J. Wysocki
2025-05-23  4:25       ` Shashank Balaji
2025-05-23 19:06         ` Rafael J. Wysocki
2025-05-23 21:47           ` Russell Haley
2025-05-27  8:21           ` Shashank Balaji
2025-05-27 12:00             ` 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=b62c0462-8185-4eb8-8ac6-7f2abc387768@gmail.com \
    --to=yumpusamongus@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=shashank.mahadasyam@sony.com \
    --cc=shinya.takumi@sony.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