Skip to content

Commit 7802fce

Browse files
committed
cpufreq: intel_pstate: Make it possible to avoid enabling CAS
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 <[email protected]> Acked-by:Srinivas Pandruvada <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0ad2507 commit 7802fce

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,9 @@
23162316
per_cpu_perf_limits
23172317
Allow per-logical-CPU P-State performance control limits using
23182318
cpufreq sysfs interface
2319+
no_cas
2320+
Do not enable capacity-aware scheduling (CAS) on
2321+
hybrid systems
23192322

23202323
intremap= [X86-64,Intel-IOMMU,EARLY]
23212324
on enable Interrupt Remapping (default)

Documentation/admin-guide/pm/intel_pstate.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ of them have to be prepended with the ``intel_pstate=`` prefix.
696696
Use per-logical-CPU P-State limits (see `Coordination of P-state
697697
Limits`_ for details).
698698

699+
``no_cas``
700+
Do not enable capacity-aware scheduling (CAS) which is enabled by
701+
default on hybrid systems.
699702

700703
Diagnostics and Tuning
701704
======================

drivers/cpufreq/intel_pstate.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ static struct freq_attr *hwp_cpufreq_attrs[] = {
936936
NULL,
937937
};
938938

939+
static bool no_cas __ro_after_init;
940+
939941
static struct cpudata *hybrid_max_perf_cpu __read_mostly;
940942
/*
941943
* Protects hybrid_max_perf_cpu, the capacity_perf fields in struct cpudata,
@@ -1041,6 +1043,10 @@ static void hybrid_refresh_cpu_capacity_scaling(void)
10411043

10421044
static void hybrid_init_cpu_capacity_scaling(bool refresh)
10431045
{
1046+
/* Bail out if enabling capacity-aware scheduling is prohibited. */
1047+
if (no_cas)
1048+
return;
1049+
10441050
/*
10451051
* If hybrid_max_perf_cpu is set at this point, the hybrid CPU capacity
10461052
* scaling has been enabled already and the driver is just changing the
@@ -3835,6 +3841,9 @@ static int __init intel_pstate_setup(char *str)
38353841
if (!strcmp(str, "no_hwp"))
38363842
no_hwp = 1;
38373843

3844+
if (!strcmp(str, "no_cas"))
3845+
no_cas = true;
3846+
38383847
if (!strcmp(str, "force"))
38393848
force_load = 1;
38403849
if (!strcmp(str, "hwp_only"))

0 commit comments

Comments
 (0)