mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCHv4 1/2] sched/isolation: Split out the housekeeping part
@ 2025-10-28  3:43 Pingfan Liu
  2025-10-28  3:43 ` [PATCHv4 2/2] sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug Pingfan Liu
  2025-10-29 14:56 ` [PATCHv4 1/2] sched/isolation: Split out the housekeeping part Waiman Long
  0 siblings, 2 replies; 17+ messages in thread
From: Pingfan Liu @ 2025-10-28  3:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pingfan Liu, Waiman Long, Peter Zijlstra, Juri Lelli,
	Pierre Gondois, Frederic Weisbecker, Ingo Molnar

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@redhat.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
To: linux-kernel@vger.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


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

end of thread, other threads:[~2025-11-05  7:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28  3:43 [PATCHv4 1/2] sched/isolation: Split out the housekeeping part Pingfan Liu
2025-10-28  3:43 ` [PATCHv4 2/2] sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug Pingfan Liu
2025-10-29  2:37   ` Chen Ridong
2025-10-29 11:18     ` Pingfan Liu
2025-10-30  6:44       ` Chen Ridong
2025-10-30 10:45         ` Pingfan Liu
2025-10-31  0:47           ` Chen Ridong
2025-10-31 14:21             ` Pingfan Liu
2025-11-03  3:17               ` Pingfan Liu
2025-10-29 15:31   ` Waiman Long
2025-10-30 10:41     ` Pingfan Liu
2025-11-03 13:50     ` Juri Lelli
2025-11-04  3:34       ` Pingfan Liu
2025-11-04  3:42         ` Waiman Long
2025-11-05  2:23   ` Chen Ridong
2025-11-05  7:11     ` Pingfan Liu
2025-10-29 14:56 ` [PATCHv4 1/2] sched/isolation: Split out the housekeeping part Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®