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: <20240403150543.2793354-3-pierre.gondois@arm.com>
Date: Wed,  3 Apr 2024 17:05:34 +0200
From: Pierre Gondois <pierre.gondois@....com>
To: linux-kernel@...r.kernel.org
Cc: Aaron Lu <aaron.lu@...el.com>,
	Rui Zhang <rui.zhang@...el.com>,
	Pierre Gondois <pierre.gondois@....com>,
	Anna-Maria Behnsen <anna-maria@...utronix.de>,
	Frederic Weisbecker <frederic@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>,
	Mel Gorman <mgorman@...e.de>,
	Daniel Bristot de Oliveira <bristot@...hat.com>,
	Valentin Schneider <vschneid@...hat.com>,
	Michal Hocko <mhocko@...e.com>,
	Waiman Long <longman@...hat.com>,
	Tejun Heo <tj@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH 2/7] sched/isolation: Move HK_TYPE_SCHED to housekeeping runtime

The HK_TYPE_SCHED isolation mask is never modified. It is however
referenced in the scheduler code to ignore CPUs not taking part in
load balancing for instance.

Move the HK_TYPE_SCHED to the newly created housekeeping runtime
type. Places where HK_TYPE_SCHED is used are not impacted as:
- the HKR_FLAG_SCHED flag isn't used by the isolcpus/nohz_full
  kernel parameters
- masks not set though kernel parameters default to the
  cpu_online_mask

Signed-off-by: Pierre Gondois <pierre.gondois@....com>
---
 include/linux/sched/isolation.h | 2 +-
 kernel/sched/fair.c             | 4 ++--
 kernel/sched/isolation.c        | 5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
index 5d2f40c6f04c..80b4e26a1b73 100644
--- a/include/linux/sched/isolation.h
+++ b/include/linux/sched/isolation.h
@@ -7,6 +7,7 @@
 #include <linux/tick.h>
 
 enum hkr_type {
+	HKR_TYPE_SCHED,
 	HKR_TYPE_MAX
 };
 
@@ -14,7 +15,6 @@ enum hk_type {
 	HK_TYPE_TIMER,
 	HK_TYPE_RCU,
 	HK_TYPE_MISC,
-	HK_TYPE_SCHED,
 	HK_TYPE_TICK,
 	HK_TYPE_DOMAIN,
 	HK_TYPE_WQ,
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1dd37168da50..e3d707243ca7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -12083,7 +12083,7 @@ void nohz_balance_enter_idle(int cpu)
 		return;
 
 	/* Spare idle load balancing on CPUs that don't want to be disturbed: */
-	if (!housekeeping_cpu(cpu, HK_TYPE_SCHED))
+	if (!housekeeping_runtime_test_cpu(cpu, HKR_TYPE_SCHED))
 		return;
 
 	/*
@@ -12309,7 +12309,7 @@ static void nohz_newidle_balance(struct rq *this_rq)
 	 * This CPU doesn't want to be disturbed by scheduler
 	 * housekeeping
 	 */
-	if (!housekeeping_cpu(this_cpu, HK_TYPE_SCHED))
+	if (!housekeeping_runtime_test_cpu(this_cpu, HKR_TYPE_SCHED))
 		return;
 
 	/* Will wake up very soon. No time for doing anything else*/
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 5acbed870c28..735925578815 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -8,11 +8,14 @@
  *
  */
 
+enum hk_runtime_flags {
+	HKR_FLAG_SCHED		= BIT(HKR_TYPE_SCHED),
+};
+
 enum hk_flags {
 	HK_FLAG_TIMER		= BIT(HK_TYPE_TIMER),
 	HK_FLAG_RCU		= BIT(HK_TYPE_RCU),
 	HK_FLAG_MISC		= BIT(HK_TYPE_MISC),
-	HK_FLAG_SCHED		= BIT(HK_TYPE_SCHED),
 	HK_FLAG_TICK		= BIT(HK_TYPE_TICK),
 	HK_FLAG_DOMAIN		= BIT(HK_TYPE_DOMAIN),
 	HK_FLAG_WQ		= BIT(HK_TYPE_WQ),
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ