Skip to content

Commit 5cc9581

Browse files
committed
intel_idle: introduce 'no_native' module parameter
JIRA: https://issues.redhat.com/browse/RHEL-85522 commit 5e7e39a Author: David Arcari <darcari@redhat.com> Date: Thu Feb 20 10:11:20 2025 -0500 intel_idle: introduce 'no_native' module parameter Since commit 1873495 ("intel_idle: Use ACPI _CST for processor models without C-state tables") the intel_idle driver has had the ability to use the ACPI _CST to populate C-states when the processor model is not recognized. However, even when the processor model is recognized (native mode) there are cases where it is useful to make the driver ignore the per-CPU idle states in lieu of ACPI C-states (such as specific application performance). Add a new 'no_native' module parameter to provide this functionality. Signed-off-by: David Arcari <darcari@redhat.com> Link: https://patch.msgid.link/20250220151120.1131122-1-darcari@redhat.com Reviewed-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> [ rjw: Spell CPU in capitals ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 84d7dd3 commit 5cc9581

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

Documentation/admin-guide/pm/intel_idle.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,19 @@ even if they have been enumerated (see :ref:`cpu-pm-qos` in
192192
Documentation/admin-guide/pm/cpuidle.rst).
193193
Setting ``max_cstate`` to 0 causes the ``intel_idle`` initialization to fail.
194194

195-
The ``no_acpi`` and ``use_acpi`` module parameters (recognized by ``intel_idle``
196-
if the kernel has been configured with ACPI support) can be set to make the
197-
driver ignore the system's ACPI tables entirely or use them for all of the
198-
recognized processor models, respectively (they both are unset by default and
199-
``use_acpi`` has no effect if ``no_acpi`` is set).
195+
The ``no_acpi``, ``use_acpi`` and ``no_native`` module parameters are
196+
recognized by ``intel_idle`` if the kernel has been configured with ACPI
197+
support. In the case that ACPI is not configured these flags have no impact
198+
on functionality.
199+
200+
``no_acpi`` - Do not use ACPI at all. Only native mode is available, no
201+
ACPI mode.
202+
203+
``use_acpi`` - No-op in ACPI mode, the driver will consult ACPI tables for
204+
C-states on/off status in native mode.
205+
206+
``no_native`` - Work only in ACPI mode, no native mode available (ignore
207+
all custom tables).
200208

201209
The value of the ``states_off`` module parameter (0 by default) represents a
202210
list of idle states to be disabled by default in the form of a bitmask.

drivers/idle/intel_idle.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,10 @@ static bool force_use_acpi __read_mostly; /* No effect if no_acpi is set. */
17011701
module_param_named(use_acpi, force_use_acpi, bool, 0444);
17021702
MODULE_PARM_DESC(use_acpi, "Use ACPI _CST for building the idle states list");
17031703

1704+
static bool no_native __read_mostly; /* No effect if no_acpi is set. */
1705+
module_param_named(no_native, no_native, bool, 0444);
1706+
MODULE_PARM_DESC(no_native, "Ignore cpu specific (native) idle states in lieu of ACPI idle states");
1707+
17041708
static struct acpi_processor_power acpi_state_table __initdata;
17051709

17061710
/**
@@ -1841,6 +1845,11 @@ static bool __init intel_idle_off_by_default(unsigned int flags, u32 mwait_hint)
18411845
}
18421846
return true;
18431847
}
1848+
1849+
static inline bool ignore_native(void)
1850+
{
1851+
return no_native && !no_acpi;
1852+
}
18441853
#else /* !CONFIG_ACPI_PROCESSOR_CSTATE */
18451854
#define force_use_acpi (false)
18461855

@@ -1850,6 +1859,7 @@ static inline bool intel_idle_off_by_default(unsigned int flags, u32 mwait_hint)
18501859
{
18511860
return false;
18521861
}
1862+
static inline bool ignore_native(void) { return false; }
18531863
#endif /* !CONFIG_ACPI_PROCESSOR_CSTATE */
18541864

18551865
/**
@@ -2346,6 +2356,10 @@ static int __init intel_idle_init(void)
23462356
pr_debug("MWAIT substates: 0x%x\n", mwait_substates);
23472357

23482358
icpu = (const struct idle_cpu *)id->driver_data;
2359+
if (icpu && ignore_native()) {
2360+
pr_debug("ignoring native CPU idle states\n");
2361+
icpu = NULL;
2362+
}
23492363
if (icpu) {
23502364
if (icpu->state_table)
23512365
cpuidle_state_table = icpu->state_table;

0 commit comments

Comments
 (0)