Skip to content

intel_pstate: Turbo disabled handling rework

Rafael J. Wysocki linux-pm lkml 1 version In review

Get series with b4
b4 am 13494237.uLZWGnKmhe@kreacher

Versions newest first

  1. v1 Latest6 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into callerdrivers/cpufreq/intel_pstate.c+4 -91 reply
2/6cpufreq: intel_pstate: Do not update global.turbo_disabled after initializationdrivers/cpufreq/intel_pstate.c+8 -4324 replies
3/6cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo()drivers/cpufreq/intel_pstate.c+18 -160 replies
4/6cpufreq: intel_pstate: Read global.no_turbo under READ_ONCE()drivers/cpufreq/intel_pstate.c+6 -60 replies
5/6cpufreq: intel_pstate: Replace three global.turbo_disabled checksdrivers/cpufreq/intel_pstate.c+5 -40 replies
6/6cpufreq: intel_pstate: Update the maximum CPU frequency consistentlydrivers/cpufreq/intel_pstate.c+18 -52 replies
6/6cpufreq: intel_pstate: Update the maximum CPU frequency consistentlydrivers/cpufreq/intel_pstate.c+18 -50 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSrinivas PandruvadaXi Ruoyao
SeriesA-b
1/6A-b
2/6T-b
3/6
4/6
5/6
6/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/6] intel_pstate: Turbo disabled handling rework

Hi Everyone,

This series reworks the handling of disabling turbo in intel_pstate on top of the previous series of cleanups

https://lore.kernel.org/linux-pm/12409658.O9o76ZdvQC@kreacher/

The underlying problem is that disabling turbo is handled quite consistently in intel_pstate and basically it can get disabled at any time (through MSR_IA32_MISC_ENABLE_TURBO_DISABLE) without much coordination with the cpufreq core or anything else.

Disabling turbo through the "no_turbo" sysfs attribute is more consistent, but it has issues too (for example, if turbo is disabled via "no_turbo", the frequency-invariance code gets notified on the turbo status change, but the actual maximum frequency of the CPU is only updated if the MSR_IA32_MISC_ENABLE_TURBO_DISABLE value changes either, which need not happen at the same time or even at all).

The first patch is not really related to the rest of the series, it's just a cleanup and can be applied separately.

Patch [2/6] uses the observation that it should be necessary to read MSR_IA32_MISC_ENABLE_TURBO_DISABLE after driver initialization to remove in-flight reads on that MSR and turbo state updates related to them.

Patch [3/6] builds on top of the previous one to adjust the "no_turbo" attribute "store" and "show" callbacks.

Patch [4/6] adds READ_ONCE() annotations to global.no_turbo accesses and makes some related simplifications.

Patch [5/6] replaces the cached MSR_IA32_MISC_ENABLE_TURBO_DISABLE value in some checks with global.no_turbo for consistency.

Patch [6/6] makes all of the code paths where the maximum CPU frequency can change to do that consistently by using the same set of functions.

Details are described in the individual patch changelogs.

Thanks!