cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Feb 2021 19:24:46 +0000 (20:24 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 18 Feb 2021 17:34:56 +0000 (18:34 +0100)
commit538b0188da4653b9f4511a114f014354fb6fb7a5
tree5a7182e8b9053a46095d72830e077b3c8ba210b2
parent8a3f1f181d39892e6ca11485a3c3ec15bb8e1a60
cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known

Commit 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover
boost frequencies") attempted to address a performance issue involving
acpi-cpufreq, the schedutil governor and scale-invariance on x86 by
extending the frequency tables created by acpi-cpufreq to cover the
entire range of "turbo" (or "boost") frequencies, but that caused
frequencies reported via /proc/cpuinfo and the scaling_cur_freq
attribute in sysfs to change which may confuse users and monitoring
tools.

For this reason, revert the part of commit 3c55e94c0ade adding the
extra entry to the frequency table and use the observation that
in principle cpuinfo.max_freq need not be equal to the maximum
frequency listed in the frequency table for the given policy.

Namely, modify cpufreq_frequency_table_cpuinfo() to allow cpufreq
drivers to set their own cpuinfo.max_freq above that frequency and
change  acpi-cpufreq to set cpuinfo.max_freq to the maximum boost
frequency found via CPPC.

This should be sufficient to let all of the cpufreq subsystem know
the real maximum frequency of the CPU without changing frequency
reporting.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=211305
Fixes: 3c55e94c0ade ("cpufreq: ACPI: Extend frequency tables to cover boost frequencies")
Reported-by: Matt McDonald <gardotd426@gmail.com>
Tested-by: Matt McDonald <gardotd426@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Giovanni Gherdovich <ggherdovich@suse.cz>
Tested-by: Michael Larabel <Michael@phoronix.com>
Cc: 5.11+ <stable@vger.kernel.org> # 5.11+
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/freq_table.c