All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask
@ 2026-11-01 19:21 Yury Norov
  2026-11-01 19:21 ` [PATCH 1/6] sched: decouple PREFERRED_CPU from PARAVIRT in Kconfig.preempt Yury Norov
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Yury Norov @ 2026-11-01 19:21 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Thomas Gleixner, Juri Lelli,
	Vincent Guittot, Shrikanth Hegde
  Cc: Yury Norov, Yury Norov, Rafael J. Wysocki, Alexander Gordeev,
	Andrea Righi, Ben Segall, Christian Borntraeger, Danilo Krummrich,
	Dietmar Eggemann, Greg Kroah-Hartman, Heiko Carstens,
	Johan Hovold, Jonathan Corbet, K Prateek Nayak, Mel Gorman,
	Mete Durlu, Randy Dunlap, Rasmus Villemoes, Shuah Khan,
	Steven Rostedt, Sven Schnelle, Valentin Schneider, Vasily Gorbik,
	linux-kernel, linux-doc, driver-core, linux-s390

The preferred CPU mask currently lets the steal governor reduce vCPU
demand when physical CPUs are contended. This series adds manual control,
opening more use cases.

For example, setting CPUs aside for selected fair tasks at runtime while
steering other fair tasks toward the remaining CPUs.

A user can mark a CPU non-preferred and pin a workload to it. Fair tasks
whose affinity includes preferred CPUs are steered away, while tasks
whose allowed CPUs contain no preferred CPU can still run there. The CPU
stays online, task affinity is preserved, and the selection can be
reversed without rebooting:

    # rmmod steal_governor
    # echo 0 > /sys/devices/system/cpu/cpu3/preferred
    # taskset -c 3 ./my_workload
    # echo 1 > /sys/devices/system/cpu/cpu3/preferred

The current preferred list is still readable from:

    /sys/devices/system/cpu/preferred

This provides task-placement isolation similar to a use of
isolcpus=domain, with a runtime interface. Scheduling domains remain
intact, tick suppression, RCU offloading, and managed-IRQ avoidance
can be configured separately when needed.

Different preferred cpumask governors may coexist; all update the
same mask under common locking. Manual settings are not privileged,
and later governor updates may override them.

The first patch relaxes preferred cpumask dependency on config PARAVIRT,
because the manual control has a broader use. Even if preferred cpumask
is intended to be used by steal governor, it doesn't require config
PARAVIRT because s390/LPAR doesn't enable the config for their
hardware assisted virtualization. Thus, patch #1 may be applied
separately from the rest of the series.

Yury Norov (6):
  sched: decouple PREFERRED_CPU from PARAVIRT in Kconfig.preempt
  cpumask: Add reset_preferred_cpumask() helper
  sched: Restore preferred CPUs when hotplug removes the last one
  sched: serialize preferred cpumask update better
  virt: steal_governor: Warn on unexpected preferred mask states
  cpu: Add per-CPU preferred sysfs control

 .../ABI/testing/sysfs-devices-system-cpu      | 14 ++---
 .../sysfs-devices-system-cpu-preferred        | 37 +++++++++++++
 Documentation/scheduler/sched-paravirt.rst    | 26 +++++++--
 drivers/base/cpu.c                            | 55 +++++++++++++++++++
 drivers/virt/Kconfig                          |  8 ++-
 drivers/virt/steal_governor.c                 | 36 +++++++-----
 include/linux/cpumask.h                       | 20 +++++++
 kernel/Kconfig.preempt                        | 19 ++++++-
 kernel/cpu.c                                  |  4 ++
 kernel/sched/core.c                           |  8 +++
 10 files changed, 196 insertions(+), 31 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-system-cpu-preferred

-- 
2.53.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-11-02 14:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01 19:21 [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask Yury Norov
2026-11-01 19:21 ` [PATCH 1/6] sched: decouple PREFERRED_CPU from PARAVIRT in Kconfig.preempt Yury Norov
2026-11-01 19:28   ` sashiko-bot
2026-11-02 10:16   ` Ilya Leoshkevich
2026-11-02 11:00     ` Peter Zijlstra
2026-11-02 11:34       ` Ilya Leoshkevich
2026-11-02 13:00         ` Shrikanth Hegde
2026-11-02 13:41           ` Ilya Leoshkevich
2026-11-02 14:57             ` Shrikanth Hegde
2026-11-01 19:21 ` [PATCH 2/6] cpumask: Add reset_preferred_cpumask() helper Yury Norov
2026-11-01 19:28   ` sashiko-bot
2026-11-01 19:21 ` [PATCH 3/6] sched: Restore preferred CPUs when hotplug removes the last one Yury Norov
2026-11-01 19:32   ` sashiko-bot
2026-11-01 19:22 ` [PATCH 4/6] sched: serialize preferred cpumask update better Yury Norov
2026-11-01 19:32   ` sashiko-bot
2026-11-01 19:22 ` [PATCH 5/6] virt: steal_governor: Warn on unexpected preferred mask states Yury Norov
2026-11-01 19:36   ` sashiko-bot
2026-11-01 19:22 ` [PATCH 6/6] cpu: Add per-CPU preferred sysfs control Yury Norov
2026-11-01 19:40   ` sashiko-bot
2026-11-02  8:47 ` [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.