Re: [PATCH v1] cpufreq: intel_pstate: Adjust the .adjust_perf() driver callback

From: Viresh Kumar

Date: Thu Jun 18 2026 - 01:57:16 EST


On 17-06-26, 18:14, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> In some cases, the processor may not actually stick to the "desired"
> performance level programmed through the driver's .adjust_perf()
> callback and may go above it, which may not be desirable (for instance,
> there may be a UCLAMP_MAX limit set for the task currently running on
> the given CPU which should be respected).
>
> Address that by adjusting the .adjust_perf() callback to take an
> additional argument, max_perf, representing the maximum allowed
> performance level of the CPU and update the intel_pstate driver to
> take that argument into account as appropriate.
>
> Accordingly, adjust cpufreq_driver_adjust_perf() and the other existing
> user of .adjust_perf(), which is the amd-pstate driver (but the behavior
> of that driver is not changed).
>
> While at it, also update the cpufreq_driver_adjust_perf()
> documentation to reflect this change and some previous code
> changes that have not been taken into account in it.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/cpufreq/amd-pstate.c | 1 +
> drivers/cpufreq/cpufreq.c | 14 +++++++++-----
> drivers/cpufreq/intel_pstate.c | 9 ++++++++-
> include/linux/cpufreq.h | 2 ++
> kernel/sched/cpufreq_schedutil.c | 4 +++-
> 5 files changed, 23 insertions(+), 7 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

--
viresh