[PATCH v1 0/7] sched: Adjust affinity according to change of housekeeping cpumask

From: Costa Shulyupin
Date: Thu May 16 2024 - 15:11:29 EST


The housekeeping CPU masks, set up by the "isolcpus" and "nohz_full"
boot command line options, are used at boot time to exclude selected
CPUs from running some kernel housekeeping facilities to minimize
disturbance to latency sensitive userspace applications such as DPDK.

However, these options can have negative consequences for "normal"
workloads. Both nohz_full and rcu_nocbs can be applied to a subset of
the CPUs on a server (so as to not impact the "normal" workloads), but
they can only be changed with a reboot. This is a problem for
containerized workloads running on OpenShift (i.e. kubernetes) where a
mix of low latency and "normal" workloads can be created/destroyed
dynamically and the number of CPUs allocated to each workload is often
not known at boot time.

This series of patches is based on series
"isolation: Exclude dynamically isolated CPUs from housekeeping masks"
https://lore.kernel.org/lkml/20240229021414.508972-1-longman@xxxxxxxxxx/
Its purpose is to exclude dynamically isolated CPUs from some
housekeeping masks so that subsystems that check the housekeeping masks
at run time will not use those isolated CPUs.

However, some of subsystems can use obsolete housekeeping CPU masks.
Therefore, to prevent the use of these isolated CPUs, it is necessary to
explicitly propagate changes of the housekeeping masks to all subsystems
depending on the mask.

Costa Shulyupin (7):
sched/isolation: Add infrastructure to adjust affinity for dynamic CPU
isolation
sched/isolation: Adjust affinity of timers according to change of
housekeeping cpumask
sched/isolation: Adjust affinity of hrtimers according to change of
housekeeping cpumask
sched/isolation: Adjust affinity of managed irqs according to change
of housekeeping cpumask
[NOT-FOR-MERGE] test timers affinity adjustment
[NOT-FOR-MERGE] test timers and hrtimers affinity adjustment
[NOT-FOR-MERGE] test managed irqs affinity adjustment

include/linux/hrtimer.h | 2 +
include/linux/timer.h | 2 +
init/Kconfig | 1 +
kernel/cgroup/cpuset.c | 3 +-
kernel/sched/isolation.c | 119 +++++++++++++++++++++++++++++++++++++--
kernel/time/hrtimer.c | 81 ++++++++++++++++++++++++++
kernel/time/timer.c | 64 +++++++++++++++++++++
tests/managed_irq.c | 71 +++++++++++++++++++++++
tests/timers.c | 58 +++++++++++++++++++
9 files changed, 395 insertions(+), 6 deletions(-)
create mode 100644 tests/managed_irq.c
create mode 100644 tests/timers.c

--
2.45.0