[PATCH v3 03/20] kconfig: Provide PREFERRED_CPU option
From: Shrikanth Hegde
Date: Thu May 14 2026 - 11:36:00 EST
Introduce a new config named PREFERRED_CPU.
This helps to:
- Avoid the code bloat when PREFERRED_CPU=n. In that cases preferred
is same as online.
- Avoid the ifdeffery around PREFERRED_CPU in many files.
Since par-avirtual use case is the main driving force of this
feature, make it default for kernels with PARAVIRT=y
Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
kernel/Kconfig.preempt | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index 88c594c6d7fc..495252fef768 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -192,3 +192,16 @@ config SCHED_CLASS_EXT
For more information:
Documentation/scheduler/sched-ext.rst
https://github.com/sched-ext/scx
+
+config PREFERRED_CPU
+ bool "Dynamic vCPU management based on steal time"
+ default y if PARAVIRT && SMP
+ help
+ This feature helps to reduce the steal time in paravirtualised
+ environment, there by reducing vCPU preemption. Reducing vCPU
+ preemption provides improved lock holder preemption and reduces
+ cost of vCPU preemption in the host.
+
+ By default preferred CPUs will be same as online CPUs. Depending
+ on the steal time when steal monitor is enabled, preferred CPUs
+ could become subset of online CPUs.
--
2.47.3