cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Mar 2024 17:02:42 +0000 (18:02 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Apr 2024 10:56:58 +0000 (12:56 +0200)
commit0940f1a8011fd69be5082015068e0dc31c800c20
treeb6841388b5bcbd35610e7cc275e912957988deae
parent032c5565eb80edb6f2faeb31939540c897987119
cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization

The global.turbo_disabled is updated quite often, especially in the
passive mode in which case it is updated every time the scheduler calls
into the driver.  However, this is generally not necessary and it adds
MSR read overhead to scheduler code paths (and that particular MSR is
slow to read).

For this reason, make the driver read MSR_IA32_MISC_ENABLE_TURBO_DISABLE
just once at the cpufreq driver registration time and remove all of the
in-flight updates of global.turbo_disabled.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
drivers/cpufreq/intel_pstate.c