[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251028034357.11055-1-piliu@redhat.com>
Date: Tue, 28 Oct 2025 11:43:55 +0800
From: Pingfan Liu <piliu@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Pingfan Liu <piliu@...hat.com>,
Waiman Long <longman@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Pierre Gondois <pierre.gondois@....com>,
Frederic Weisbecker <frederic@...nel.org>,
Ingo Molnar <mingo@...hat.com>
Subject: [PATCHv4 1/2] sched/isolation: Split out the housekeeping part
A later patch will introduce a function in cpuset.h that refers to
definitions in isolation.h. This would cause a circular header file
inclusion issue. To break the cycle, move the definitions into a
dedicated file called 'housekeeping.h'."
Signed-off-by: Pingfan Liu <piliu@...hat.com>
Cc: Waiman Long <longman@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Juri Lelli <juri.lelli@...hat.com>
Cc: Pierre Gondois <pierre.gondois@....com>
Cc: Frederic Weisbecker <frederic@...nel.org>
Cc: Ingo Molnar <mingo@...hat.com>
To: linux-kernel@...r.kernel.org
---
include/linux/sched/housekeeping.h | 67 ++++++++++++++++++++++++++++++
include/linux/sched/isolation.h | 65 +----------------------------
2 files changed, 68 insertions(+), 64 deletions(-)
create mode 100644 include/linux/sched/housekeeping.h
diff --git a/include/linux/sched/housekeeping.h b/include/linux/sched/housekeeping.h
new file mode 100644
index 0000000000000..99cfc8821a814
--- /dev/null
+++ b/include/linux/sched/housekeeping.h
@@ -0,0 +1,67 @@
+#ifndef _LINUX_SCHED_HOUSEKEEPING_H
+#define _LINUX_SCHED_HOUSEKEEPING_H
+
+enum hk_type {
+ HK_TYPE_DOMAIN,
+ HK_TYPE_MANAGED_IRQ,
+ HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_MAX,
+
+ /*
+ * The following housekeeping types are only set by the nohz_full
+ * boot commandline option. So they can share the same value.
+ */
+ HK_TYPE_TICK = HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_TIMER = HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_RCU = HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_MISC = HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_WQ = HK_TYPE_KERNEL_NOISE,
+ HK_TYPE_KTHREAD = HK_TYPE_KERNEL_NOISE
+};
+
+#ifdef CONFIG_CPU_ISOLATION
+DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
+extern int housekeeping_any_cpu(enum hk_type type);
+extern const struct cpumask *housekeeping_cpumask(enum hk_type type);
+extern bool housekeeping_enabled(enum hk_type type);
+extern void housekeeping_affine(struct task_struct *t, enum hk_type type);
+extern bool housekeeping_test_cpu(int cpu, enum hk_type type);
+extern void __init housekeeping_init(void);
+
+#else
+
+static inline int housekeeping_any_cpu(enum hk_type type)
+{
+ return smp_processor_id();
+}
+
+static inline const struct cpumask *housekeeping_cpumask(enum hk_type type)
+{
+ return cpu_possible_mask;
+}
+
+static inline bool housekeeping_enabled(enum hk_type type)
+{
+ return false;
+}
+
+static inline void housekeeping_affine(struct task_struct *t,
+ enum hk_type type) { }
+
+static inline bool housekeeping_test_cpu(int cpu, enum hk_type type)
+{
+ return true;
+}
+
+static inline void housekeeping_init(void) { }
+#endif /* CONFIG_CPU_ISOLATION */
+
+static inline bool housekeeping_cpu(int cpu, enum hk_type type)
+{
+#ifdef CONFIG_CPU_ISOLATION
+ if (static_branch_unlikely(&housekeeping_overridden))
+ return housekeeping_test_cpu(cpu, type);
+#endif
+ return true;
+}
+#endif
diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index d8501f4709b58..e07b2c439365d 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -5,70 +5,7 @@
#include <linux/cpuset.h>
#include <linux/init.h>
#include <linux/tick.h>
-
-enum hk_type {
- HK_TYPE_DOMAIN,
- HK_TYPE_MANAGED_IRQ,
- HK_TYPE_KERNEL_NOISE,
- HK_TYPE_MAX,
-
- /*
- * The following housekeeping types are only set by the nohz_full
- * boot commandline option. So they can share the same value.
- */
- HK_TYPE_TICK = HK_TYPE_KERNEL_NOISE,
- HK_TYPE_TIMER = HK_TYPE_KERNEL_NOISE,
- HK_TYPE_RCU = HK_TYPE_KERNEL_NOISE,
- HK_TYPE_MISC = HK_TYPE_KERNEL_NOISE,
- HK_TYPE_WQ = HK_TYPE_KERNEL_NOISE,
- HK_TYPE_KTHREAD = HK_TYPE_KERNEL_NOISE
-};
-
-#ifdef CONFIG_CPU_ISOLATION
-DECLARE_STATIC_KEY_FALSE(housekeeping_overridden);
-extern int housekeeping_any_cpu(enum hk_type type);
-extern const struct cpumask *housekeeping_cpumask(enum hk_type type);
-extern bool housekeeping_enabled(enum hk_type type);
-extern void housekeeping_affine(struct task_struct *t, enum hk_type type);
-extern bool housekeeping_test_cpu(int cpu, enum hk_type type);
-extern void __init housekeeping_init(void);
-
-#else
-
-static inline int housekeeping_any_cpu(enum hk_type type)
-{
- return smp_processor_id();
-}
-
-static inline const struct cpumask *housekeeping_cpumask(enum hk_type type)
-{
- return cpu_possible_mask;
-}
-
-static inline bool housekeeping_enabled(enum hk_type type)
-{
- return false;
-}
-
-static inline void housekeeping_affine(struct task_struct *t,
- enum hk_type type) { }
-
-static inline bool housekeeping_test_cpu(int cpu, enum hk_type type)
-{
- return true;
-}
-
-static inline void housekeeping_init(void) { }
-#endif /* CONFIG_CPU_ISOLATION */
-
-static inline bool housekeeping_cpu(int cpu, enum hk_type type)
-{
-#ifdef CONFIG_CPU_ISOLATION
- if (static_branch_unlikely(&housekeeping_overridden))
- return housekeeping_test_cpu(cpu, type);
-#endif
- return true;
-}
+#include <linux/sched/housekeeping.h>
static inline bool cpu_is_isolated(int cpu)
{
--
2.49.0
Powered by blists - more mailing lists