lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250410092423.9831-3-alexs@kernel.org>
Date: Thu, 10 Apr 2025 17:24:18 +0800
From: alexs@...nel.org
To: 
Cc: linux-kernel@...r.kernel.org,
	Alex Shi <alexs@...nel.org>,
	Frederic Weisbecker <frederic@...nel.org>,
	Waiman Long <longman@...hat.com>,
	Lai Jiangshan <jiangshanlai@...il.com>,
	Tejun Heo <tj@...nel.org>,
	Valentin Schneider <vschneid@...hat.com>,
	Ben Segall <bsegall@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>
Subject: [PATCH 3/4] sched/isolation: merge housekeeping_cpu() and housekeeping_test_cpu()

From: Alex Shi <alexs@...nel.org>

Since the function just call housekeeping_test_cpu() without doing any other
things, we could just merge them together with name housekeeping_cpu();

Signed-off-by: Alex Shi <alexs@...nel.org>
Cc: Frederic Weisbecker <frederic@...nel.org>
Cc: Waiman Long <longman@...hat.com>
Cc: Lai Jiangshan <jiangshanlai@...il.com>
Cc: Tejun Heo <tj@...nel.org>
Cc: Valentin Schneider <vschneid@...hat.com>
Cc: Ben Segall <bsegall@...gle.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Juri Lelli <juri.lelli@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>
---
 include/linux/sched/isolation.h | 19 +++++++------------
 kernel/sched/isolation.c        |  4 ++--
 kernel/workqueue.c              |  2 +-
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index 231bc5766f76..90e46440fc85 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -30,7 +30,7 @@ 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 bool housekeeping_cpu(int cpu, enum hk_type type);
 extern void __init housekeeping_init(void);
 
 #else
@@ -50,26 +50,21 @@ 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)
+static inline bool housekeeping_cpu(int cpu, enum hk_type type)
 {
 	return true;
 }
 
+static inline void housekeeping_affine(struct task_struct *t,
+				       enum hk_type type) { }
+
 static inline void housekeeping_init(void) { }
 #endif /* CONFIG_CPU_ISOLATION */
 
-static inline bool housekeeping_cpu(int cpu, enum hk_type type)
-{
-	return housekeeping_test_cpu(cpu, type);
-}
-
 static inline bool cpu_is_isolated(int cpu)
 {
-	return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN) ||
-	       !housekeeping_test_cpu(cpu, HK_TYPE_TICK) ||
+	return !housekeeping_cpu(cpu, HK_TYPE_DOMAIN) ||
+	       !housekeeping_cpu(cpu, HK_TYPE_TICK) ||
 	       cpuset_cpu_is_isolated(cpu);
 }
 
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 81bc8b329ef1..e93776740725 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -73,14 +73,14 @@ void housekeeping_affine(struct task_struct *t, enum hk_type type)
 }
 EXPORT_SYMBOL_GPL(housekeeping_affine);
 
-bool housekeeping_test_cpu(int cpu, enum hk_type type)
+bool housekeeping_cpu(int cpu, enum hk_type type)
 {
 	if (static_branch_unlikely(&housekeeping_overridden))
 		if (housekeeping.flags & BIT(type))
 			return cpumask_test_cpu(cpu, housekeeping.cpumasks[type]);
 	return true;
 }
-EXPORT_SYMBOL_GPL(housekeeping_test_cpu);
+EXPORT_SYMBOL_GPL(housekeeping_cpu);
 
 void __init housekeeping_init(void)
 {
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index bfe030b443e2..69a02c9e53fb 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2518,7 +2518,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
 	if (housekeeping_enabled(HK_TYPE_TIMER)) {
 		/* If the current cpu is a housekeeping cpu, use it. */
 		cpu = smp_processor_id();
-		if (!housekeeping_test_cpu(cpu, HK_TYPE_TIMER))
+		if (!housekeeping_cpu(cpu, HK_TYPE_TIMER))
 			cpu = housekeeping_any_cpu(HK_TYPE_TIMER);
 		add_timer_on(timer, cpu);
 	} else {
-- 
2.47.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ