[PATCH 01/23] sched/isolation: Add HK_TYPE_KERNEL_NOISE_BOOT & HK_TYPE_MANAGED_IRQ_BOOT

Waiman Long
2026-04-21T03:05:09Z

Since commit 4fca0e550d50 ("sched/isolation: Save boot defined
domain flags"), HK_TYPE_DOMAIN_BOOT was added to record the boot
time "isolcpus{=domain}" setting. As we are going to make the
HK_TYPE_MANAGED_IRQ and HK_TYPE_KERNEL_NOISE housekeeping cpumasks
runtime modifiable, we need some additional cpumasks to record the boot
time settings to make sure that those housekeeping cpumasks will always
be a subset of their boot time equivalents.

Introduce the new HK_TYPE_KERNEL_NOISE_BOOT and HK_TYPE_MANAGED_IRQ_BOOT
housekeeping types to do that.

Signed-off-by: Waiman Long <longman@redhat.com>
---
include/linux/sched/isolation.h | 16 ++++++++++++++--
kernel/sched/isolation.c | 16 +++++++++-------
2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index dc3975ff1b2e..d1707f121e20 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -14,10 +14,22 @@ enum hk_type {
* is always a subset of HK_TYPE_DOMAIN_BOOT.
*/
HK_TYPE_DOMAIN,
- /* Inverse of boot-time isolcpus=managed_irq argument */
- HK_TYPE_MANAGED_IRQ,
+
/* Inverse of boot-time nohz_full= or isolcpus=nohz arguments */
+ HK_TYPE_KERNEL_NOISE_BOOT,
+ /*
+ * A subset of HK_TYPE_KERNEL_NOISE_BOOT as it may excludes some
+ * additional isolated CPUs at run time.
+ */
HK_TYPE_KERNEL_NOISE,
+
+ /* Inverse of boot-time isolcpus=managed_irq argument */
+ HK_TYPE_MANAGED_IRQ_BOOT,
+ /*
+ * A subset of HK_TYPE_MANAGED_IRQ_BOOT as it may excludes some
+ * additional isolated CPUs at run time.
+ */
+ HK_TYPE_MANAGED_IRQ,
HK_TYPE_MAX,

/*
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index a947d75b43f1..9ec9ae510dc7 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -12,10 +12,12 @@
#include "sched.h"

enum hk_flags {
- HK_FLAG_DOMAIN_BOOT = BIT(HK_TYPE_DOMAIN_BOOT),
- HK_FLAG_DOMAIN = BIT(HK_TYPE_DOMAIN),
- HK_FLAG_MANAGED_IRQ = BIT(HK_TYPE_MANAGED_IRQ),
- HK_FLAG_KERNEL_NOISE = BIT(HK_TYPE_KERNEL_NOISE),
+ HK_FLAG_DOMAIN_BOOT = BIT(HK_TYPE_DOMAIN_BOOT),
+ HK_FLAG_DOMAIN = BIT(HK_TYPE_DOMAIN),
+ HK_FLAG_KERNEL_NOISE_BOOT = BIT(HK_TYPE_KERNEL_NOISE_BOOT),
+ HK_FLAG_KERNEL_NOISE = BIT(HK_TYPE_KERNEL_NOISE),
+ HK_FLAG_MANAGED_IRQ_BOOT = BIT(HK_TYPE_MANAGED_IRQ_BOOT),
+ HK_FLAG_MANAGED_IRQ = BIT(HK_TYPE_MANAGED_IRQ),
};

DEFINE_STATIC_KEY_FALSE(housekeeping_overridden);
@@ -315,7 +317,7 @@ static int __init housekeeping_nohz_full_setup(char *str)
{
unsigned long flags;

- flags = HK_FLAG_KERNEL_NOISE;
+ flags = HK_FLAG_KERNEL_NOISE | HK_FLAG_KERNEL_NOISE_BOOT;

return housekeeping_setup(str, flags);
}
@@ -334,7 +336,7 @@ static int __init housekeeping_isolcpus_setup(char *str)
*/
if (!strncmp(str, "nohz,", 5)) {
str += 5;
- flags |= HK_FLAG_KERNEL_NOISE;
+ flags |= HK_FLAG_KERNEL_NOISE | HK_FLAG_KERNEL_NOISE_BOOT;
continue;
}

@@ -346,7 +348,7 @@ static int __init housekeeping_isolcpus_setup(char *str)

if (!strncmp(str, "managed_irq,", 12)) {
str += 12;
- flags |= HK_FLAG_MANAGED_IRQ;
+ flags |= HK_FLAG_MANAGED_IRQ | HK_FLAG_MANAGED_IRQ_BOOT;
continue;
}

--
2.53.0