[PATCH 1/6] sched: decouple PREFERRED_CPU from PARAVIRT in Kconfig.preempt
From: Yury Norov
Date: Sun Nov 01 2026 - 14:22:42 EST
The IBM s390 doesn't enable PARAVIRT config for their hardware
virtualized Logical Partitions (LPAR). However, the steal time is
accounted for the LPARs, once the config VIRT_CPU_ACCOUNTING_NATIVE
is enabled.
Preferred cpumask doesn't rely on any feature gated by PARAVIRT config,
and requires it to minimize the configuration space and runtime overhead,
with the lack of non-paravirt user. Now that s390 wants to adopt preferred
cpumask, there's no reason to keep it coupled to paravirt.
Make PREFERRED_CPU a user-configurable option, even if paravirtualization
is not enabled, and drop PARAVIRT dependency on the steal governor.
Keep the default module selection conditional on PARAVIRT so other SMP
configurations can opt in without enabling the governor by default.
Link: https://lore.kernel.org/all/4605dad5-aab2-49e3-b919-bf9897181834@xxxxxxxxxxxxx/
CC: Mete Durlu <meted@xxxxxxxxxxxxx>
Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
---
Can be applied independently from the rest of the series.
drivers/virt/Kconfig | 8 ++++++--
kernel/Kconfig.preempt | 12 ++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig
index eeb84e578ddf..2e79ece24a77 100644
--- a/drivers/virt/Kconfig
+++ b/drivers/virt/Kconfig
@@ -43,9 +43,9 @@ config FSL_HV_MANAGER
config STEAL_GOVERNOR
tristate "Dynamic vCPU management based on steal time"
- depends on PARAVIRT && SMP
+ depends on SMP
select PREFERRED_CPU
- default m
+ default m if PARAVIRT
help
This driver helps to reduce the steal time in paravirtualized
environments, thereby reducing vCPU preemption costs.
@@ -55,6 +55,10 @@ config STEAL_GOVERNOR
preferred CPUs could become subset of active CPUs.
More details are at: Documentation/driver-api/steal-governor.rst
+ It doesn't depend on config PARAVIRT because certain architectures
+ like LPAR on s390 don't enable PARAVIRT for their hardware assisted
+ virtualization, while providing steal time accounting.
+
It is recommended to build it as module and load the module
to enable it.
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index edc067a0c422..fa6d0eba5b23 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -196,5 +196,13 @@ config SCHED_CLASS_EXT
https://github.com/sched-ext/scx
config PREFERRED_CPU
- bool
- depends on SMP && PARAVIRT
+ bool "Preferred CPU scheduling"
+ depends on SMP
+ help
+ Allow the fair scheduler to favor a subset of active CPUs while
+ respecting task CPU affinity. Non-preferred CPUs remain online
+ and can still run tasks whose affinity requires it.
+
+ See Documentation/scheduler/sched-paravirt.rst for details.
+
+ If unsure, say N.
--
2.53.0