sched: Decouple PREFERRED_CPU from PARAVIRT
PATCH 1/1 sched: Decouple PREFERRED_CPU from PARAVIRT
PREFERRED_CPU mechanism does not rely on any feature introduced by PARAVIRT but PREFERRED_CPU still gated behind PARAVIRT. Any architecture that would like to enable PREFERRED_CPU mechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.
As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enable PREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.
Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag HAVE_CPUTIME_STEAL to indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating from CPU_PREFERRED and add HAVE_CPUTIME_STEAL instead.
Select HAVE_CPUTIME_STEAL for s390 and powerpc-pseries configs.
[1] https://lore.kernel.org/all/[email protected]/
--- arch/Kconfig | 8 ++++++++ arch/powerpc/platforms/pseries/Kconfig | 1 + arch/s390/Kconfig | 1 + drivers/virt/Kconfig | 2 +- kernel/Kconfig.preempt | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-)
arch/Kconfig +8 -0
@@ -1080,6 +1080,14 @@ config HAVE_IRQ_TIME_ACCOUNTING config HAVE_PV_STEAL_CLOCK_GEN bool +config HAVE_CPUTIME_STEAL + bool + default y if HAVE_PV_STEAL_CLOCK_GEN + help + Selected directly by config PARAVIRT through HAVE_PV_STEAL_CLOCK_GEN + or directly by architectures that have their own CPUTIME_STEAL + accounting. + config HAVE_MOVE_PUD bool help
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -41,6 +41,7 @@ config PPC_SPLPAR depends on PPC_PSERIES select PARAVIRT_SPINLOCKS if PPC_QUEUED_SPINLOCKS select PARAVIRT_TIME_ACCOUNTING if VIRT_CPU_ACCOUNTING_GEN + select HAVE_CPUTIME_STEAL default y help Enabling this option will make the kernel run more efficiently
arch/s390/Kconfig +1 -0
@@ -204,6 +204,7 @@ config S390 select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL + select HAVE_CPUTIME_STEAL select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE
drivers/virt/Kconfig +1 -1
@@ -43,7 +43,7 @@ config FSL_HV_MANAGER config STEAL_GOVERNOR tristate "Dynamic vCPU management based on steal time" - depends on PARAVIRT && SMP + depends on SMP && HAVE_CPUTIME_STEAL select PREFERRED_CPU default m help
kernel/Kconfig.preempt +1 -1
@@ -197,4 +197,4 @@ config SCHED_CLASS_EXT config PREFERRED_CPU bool - depends on SMP && PARAVIRT + depends on SMP && HAVE_CPUTIME_STEAL
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261104-preferredcpu-b3c00594bd74
Best regards,
Signature · 1 line
Mete Durlu <[email protected]>
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 22 lines
PREFERRED_CPUmechanism does not rely on any feature introduced by PARAVIRT butPREFERRED_CPUstill gated behind PARAVIRT. Any architecture that would like to enablePREFERRED_CPUmechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enablePREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag
HAVE_CPUTIME_STEALto indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating fromCPU_PREFERREDand addHAVE_CPUTIME_STEALinstead.
SelectHAVE_CPUTIME_STEALfor s390 and powerpc-pseries configs.
Quoted 5 lines
[1] https://lore.kernel.org/all/[email protected]/
Reviewed-by Yury Norov <[email protected]>Suggested-by Peter Zijlstra <[email protected]>Signed-off-by Mete Durlu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 22 lines · Mete Durlu
PREFERRED_CPUmechanism does not rely on any feature introduced by PARAVIRT butPREFERRED_CPUstill gated behind PARAVIRT. Any architecture that would like to enablePREFERRED_CPUmechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enablePREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag
HAVE_CPUTIME_STEALto indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating fromCPU_PREFERREDand addHAVE_CPUTIME_STEALinstead.
SelectHAVE_CPUTIME_STEALfor s390 and powerpc-pseries configs.
Quoted 5 lines
[1] https://lore.kernel.org/all/[email protected]/
Reviewed-by Yury Norov <[email protected]>Suggested-by Peter Zijlstra <[email protected]>Signed-off-by Mete Durlu <[email protected]>
Quoted 80 lines
--- arch/Kconfig | 8 ++++++++ arch/powerpc/platforms/pseries/Kconfig | 1 + arch/s390/Kconfig | 1 + drivers/virt/Kconfig | 2 +- kernel/Kconfig.preempt | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-)arch/Kconfig +8
-0@@ -1080,6 +1080,14 @@ config HAVE_IRQ_TIME_ACCOUNTING config HAVE_PV_STEAL_CLOCK_GEN bool +config HAVE_CPUTIME_STEAL + bool + default y if HAVE_PV_STEAL_CLOCK_GEN + help + Selected directly by config PARAVIRT through HAVE_PV_STEAL_CLOCK_GEN + or directly by architectures that have their own CPUTIME_STEAL + accounting. + config HAVE_MOVE_PUD bool helparch/powerpc/platforms/pseries/Kconfig +1
-0@@ -41,6 +41,7 @@ config PPC_SPLPAR depends on PPC_PSERIES select PARAVIRT_SPINLOCKS if PPC_QUEUED_SPINLOCKS select PARAVIRT_TIME_ACCOUNTING if VIRT_CPU_ACCOUNTING_GEN + select HAVE_CPUTIME_STEAL default y help Enabling this option will make the kernel run more efficientlyarch/s390/Kconfig +1
-0@@ -204,6 +204,7 @@ config S390 select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL + select HAVE_CPUTIME_STEAL select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACEdrivers/virt/Kconfig +1
-1@@ -43,7 +43,7 @@ config FSL_HV_MANAGER config STEAL_GOVERNOR tristate "Dynamic vCPU management based on steal time" - depends on PARAVIRT && SMP + depends on SMP && HAVE_CPUTIME_STEAL select PREFERRED_CPU default m helpkernel/Kconfig.preempt +1
-2@@ -197,4 +197,4 @@ config SCHED_CLASS_EXT config PREFERRED_CPU bool - depends on SMP && PARAVIRT + depends on SMP && HAVE_CPUTIME_STEAL ---base-commit:
6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261104-preferredcpu-b3c00594bd74Best regards,
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: ae7ff8b29958143b4f23169a5598c860334db2fa Gitweb: https://git.kernel.org/tip/ae7ff8b29958143b4f23169a5598c860334db2fa Author: Mete Durlu <[email protected]> AuthorDate: Fri, 06 Nov 2026 13:35:12 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Mon, 09 Nov 2026 09:39:59 +01:00
sched: Decouple PREFERRED_CPU from PARAVIRT
PREFERRED_CPU mechanism does not rely on any feature introduced by PARAVIRT but PREFERRED_CPU still gated behind PARAVIRT. Any architecture that would like to enable PREFERRED_CPU mechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.
As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enable PREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.
Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag HAVE_CPUTIME_STEAL to indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating from CPU_PREFERRED and add HAVE_CPUTIME_STEAL instead.
Select HAVE_CPUTIME_STEAL for s390 and powerpc-pseries configs.
[1] https://lore.kernel.org/all/[email protected]/
--- arch/Kconfig | 8 ++++++++ arch/powerpc/platforms/pseries/Kconfig | 1 + arch/s390/Kconfig | 1 + drivers/virt/Kconfig | 2 +- kernel/Kconfig.preempt | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-)
arch/Kconfig +8 -0
@@ -1080,6 +1080,14 @@ config HAVE_IRQ_TIME_ACCOUNTING config HAVE_PV_STEAL_CLOCK_GEN bool +config HAVE_CPUTIME_STEAL + bool + default y if HAVE_PV_STEAL_CLOCK_GEN + help + Selected directly by config PARAVIRT through HAVE_PV_STEAL_CLOCK_GEN + or directly by architectures that have their own CPUTIME_STEAL + accounting. + config HAVE_MOVE_PUD bool help
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -41,6 +41,7 @@ config PPC_SPLPAR depends on PPC_PSERIES select PARAVIRT_SPINLOCKS if PPC_QUEUED_SPINLOCKS select PARAVIRT_TIME_ACCOUNTING if VIRT_CPU_ACCOUNTING_GEN + select HAVE_CPUTIME_STEAL default y help Enabling this option will make the kernel run more efficiently
arch/s390/Kconfig +1 -0
@@ -204,6 +204,7 @@ config S390 select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL + select HAVE_CPUTIME_STEAL select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE
drivers/virt/Kconfig +1 -1
@@ -43,7 +43,7 @@ config FSL_HV_MANAGER config STEAL_GOVERNOR tristate "Dynamic vCPU management based on steal time" - depends on PARAVIRT && SMP + depends on SMP && HAVE_CPUTIME_STEAL select PREFERRED_CPU default m help
kernel/Kconfig.preempt +1 -1
@@ -197,4 +197,4 @@ config SCHED_CLASS_EXT config PREFERRED_CPU bool - depends on SMP && PARAVIRT + depends on SMP && HAVE_CPUTIME_STEAL
[tip: sched/core] sched/config: Decouple PREFERRED_CPU from PARAVIRT
In reply to Mete DurluThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 56d3bd3bbc663dc3f8fa09577c76eb0205d65177 Gitweb: https://git.kernel.org/tip/56d3bd3bbc663dc3f8fa09577c76eb0205d65177 Author: Mete Durlu <[email protected]> AuthorDate: Fri, 06 Nov 2026 13:35:12 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 09 Nov 2026 10:24:06 +01:00
sched/config: Decouple PREFERRED_CPU from PARAVIRT
PREFERRED_CPU mechanism does not rely on any feature introduced by PARAVIRT but PREFERRED_CPU still gated behind PARAVIRT. Any architecture that would like to enable PREFERRED_CPU mechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.
As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enable PREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.
Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag HAVE_CPUTIME_STEAL to indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating from CPU_PREFERRED and add HAVE_CPUTIME_STEAL instead.
Select HAVE_CPUTIME_STEAL for s390 and powerpc-pseries configs.
[1] https://lore.kernel.org/all/[email protected]/
--- arch/Kconfig | 8 ++++++++ arch/powerpc/platforms/pseries/Kconfig | 1 + arch/s390/Kconfig | 1 + drivers/virt/Kconfig | 2 +- kernel/Kconfig.preempt | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-)
arch/Kconfig +8 -0
@@ -1080,6 +1080,14 @@ config HAVE_IRQ_TIME_ACCOUNTING config HAVE_PV_STEAL_CLOCK_GEN bool +config HAVE_CPUTIME_STEAL + bool + default y if HAVE_PV_STEAL_CLOCK_GEN + help + Selected directly by config PARAVIRT through HAVE_PV_STEAL_CLOCK_GEN + or directly by architectures that have their own CPUTIME_STEAL + accounting. + config HAVE_MOVE_PUD bool help
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -41,6 +41,7 @@ config PPC_SPLPAR depends on PPC_PSERIES select PARAVIRT_SPINLOCKS if PPC_QUEUED_SPINLOCKS select PARAVIRT_TIME_ACCOUNTING if VIRT_CPU_ACCOUNTING_GEN + select HAVE_CPUTIME_STEAL default y help Enabling this option will make the kernel run more efficiently
arch/s390/Kconfig +1 -0
@@ -204,6 +204,7 @@ config S390 select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL + select HAVE_CPUTIME_STEAL select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE
drivers/virt/Kconfig +1 -1
@@ -43,7 +43,7 @@ config FSL_HV_MANAGER config STEAL_GOVERNOR tristate "Dynamic vCPU management based on steal time" - depends on PARAVIRT && SMP + depends on SMP && HAVE_CPUTIME_STEAL select PREFERRED_CPU default m help
kernel/Kconfig.preempt +1 -1
@@ -197,4 +197,4 @@ config SCHED_CLASS_EXT config PREFERRED_CPU bool - depends on SMP && PARAVIRT + depends on SMP && HAVE_CPUTIME_STEAL
[tip: sched/core] sched/config: Decouple PREFERRED_CPU from PARAVIRT
In reply to Mete DurluThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 08503034111a68383774e3f0a47eabb59e21aac7 Gitweb: https://git.kernel.org/tip/08503034111a68383774e3f0a47eabb59e21aac7 Author: Mete Durlu <[email protected]> AuthorDate: Fri, 06 Nov 2026 13:35:12 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 09 Nov 2026 10:58:14 +01:00
sched/config: Decouple PREFERRED_CPU from PARAVIRT
PREFERRED_CPU mechanism does not rely on any feature introduced by PARAVIRT but PREFERRED_CPU still gated behind PARAVIRT. Any architecture that would like to enable PREFERRED_CPU mechanism has to also enable PARAVIRT and bring additional changes to accommodate PARAVIRT's requirements.
As an example, s390 doesn't enable PARAVIRT config for hardware virtualized Logical Partitions (LPAR). The steal time is accounted for the LPARs via architecture's own steal time accounting mechanism instead of the common steal time infrastructure PARAVIRT supplies.
For s390 to enable PREFERRED_CPU, PRAVIRT and its required stubs are just unncessary.
Based on the discussion between Yury Norov and Peter Zijlstra over Yury's original patch [1]:
Introduce a new config flag HAVE_CPUTIME_STEAL to indicate that the architecture has steal time measurement capabilities already implemented and to signal that PARAVIRT is not required.
Remove PARAVIRT gating from CPU_PREFERRED and add HAVE_CPUTIME_STEAL instead.
Select HAVE_CPUTIME_STEAL for s390 and powerpc-pseries configs.
[1] https://lore.kernel.org/all/[email protected]/
--- arch/Kconfig | 8 ++++++++ arch/powerpc/platforms/pseries/Kconfig | 1 + arch/s390/Kconfig | 1 + drivers/virt/Kconfig | 2 +- kernel/Kconfig.preempt | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-)
arch/Kconfig +8 -0
@@ -1080,6 +1080,14 @@ config HAVE_IRQ_TIME_ACCOUNTING config HAVE_PV_STEAL_CLOCK_GEN bool +config HAVE_CPUTIME_STEAL + bool + default y if HAVE_PV_STEAL_CLOCK_GEN + help + Selected directly by config PARAVIRT through HAVE_PV_STEAL_CLOCK_GEN + or directly by architectures that have their own CPUTIME_STEAL + accounting. + config HAVE_MOVE_PUD bool help
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -41,6 +41,7 @@ config PPC_SPLPAR depends on PPC_PSERIES select PARAVIRT_SPINLOCKS if PPC_QUEUED_SPINLOCKS select PARAVIRT_TIME_ACCOUNTING if VIRT_CPU_ACCOUNTING_GEN + select HAVE_CPUTIME_STEAL default y help Enabling this option will make the kernel run more efficiently
arch/s390/Kconfig +1 -0
@@ -204,6 +204,7 @@ config S390 select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL + select HAVE_CPUTIME_STEAL select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE
drivers/virt/Kconfig +1 -1
@@ -43,7 +43,7 @@ config FSL_HV_MANAGER config STEAL_GOVERNOR tristate "Dynamic vCPU management based on steal time" - depends on PARAVIRT && SMP + depends on SMP && HAVE_CPUTIME_STEAL select PREFERRED_CPU default m help
kernel/Kconfig.preempt +1 -1
@@ -197,4 +197,4 @@ config SCHED_CLASS_EXT config PREFERRED_CPU bool - depends on SMP && PARAVIRT + depends on SMP && HAVE_CPUTIME_STEAL