]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq: intel_pstate: Make it possible to avoid enabling CAS
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Jan 2025 13:07:12 +0000 (14:07 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 18 Feb 2025 19:47:33 +0000 (20:47 +0100)
Capacity-aware scheduling (CAS) is enabled by default by intel_pstate on
hybrid systems without SMT, but in some usage scenarios it may be more
attractive to place tasks for maximum CPU performance regardless of the
extra cost in terms of energy, which is the case on such systems when
CAS is not enabled, so introduce a command line option to forbid
intel_pstate to enable CAS.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/2781262.mvXUDI8C0e@rjwysocki.net
Documentation/admin-guide/kernel-parameters.txt
Documentation/admin-guide/pm/intel_pstate.rst
drivers/cpufreq/intel_pstate.c

index fb8752b42ec8582b8750d7e014c4d76166fa2fc1..77e671e559938d39d7940dbeb7b14a99f378a149 100644 (file)
                        per_cpu_perf_limits
                          Allow per-logical-CPU P-State performance control limits using
                          cpufreq sysfs interface
+                       no_cas
+                         Do not enable capacity-aware scheduling (CAS) on
+                         hybrid systems
 
        intremap=       [X86-64,Intel-IOMMU,EARLY]
                        on      enable Interrupt Remapping (default)
index bf13ad25a32f7203b456fe061d71b15058233348..78fc83ed2a7efbb5c5bf0fb06fcce6d7734f0c17 100644 (file)
@@ -696,6 +696,9 @@ of them have to be prepended with the ``intel_pstate=`` prefix.
        Use per-logical-CPU P-State limits (see `Coordination of P-state
        Limits`_ for details).
 
+``no_cas``
+       Do not enable capacity-aware scheduling (CAS) which is enabled by
+       default on hybrid systems.
 
 Diagnostics and Tuning
 ======================
index 9c4cc01fd51aadc3c7d4a5870033e0f851c7a42a..bc31e9b9b66035ede90b6666ed880da539770029 100644 (file)
@@ -936,6 +936,8 @@ static struct freq_attr *hwp_cpufreq_attrs[] = {
        NULL,
 };
 
+static bool no_cas __ro_after_init;
+
 static struct cpudata *hybrid_max_perf_cpu __read_mostly;
 /*
  * Protects hybrid_max_perf_cpu, the capacity_perf fields in struct cpudata,
@@ -1041,6 +1043,10 @@ static void hybrid_refresh_cpu_capacity_scaling(void)
 
 static void hybrid_init_cpu_capacity_scaling(bool refresh)
 {
+       /* Bail out if enabling capacity-aware scheduling is prohibited. */
+       if (no_cas)
+               return;
+
        /*
         * If hybrid_max_perf_cpu is set at this point, the hybrid CPU capacity
         * scaling has been enabled already and the driver is just changing the
@@ -3835,6 +3841,9 @@ static int __init intel_pstate_setup(char *str)
        if (!strcmp(str, "no_hwp"))
                no_hwp = 1;
 
+       if (!strcmp(str, "no_cas"))
+               no_cas = true;
+
        if (!strcmp(str, "force"))
                force_load = 1;
        if (!strcmp(str, "hwp_only"))