[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202081304.3103393-2-mingo@kernel.org>
Date: Tue, 2 Dec 2025 09:13:02 +0100
From: Ingo Molnar <mingo@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <frederic@...nel.org>,
Shrikanth Hegde <sshegde@...ux.ibm.com>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>
Subject: [PATCH 1/3] sched/fair: Rename the 'has_blocked_load' local variable to 'has_blocked' in _nohz_idle_balance()
There's three separate, independent pieces of logic in the
scheduler that are named 'has_blocked':
(1) nohz.has_blocked,
(2) rq->has_blocked_load - both of these relate to NOHZ balancing,
(3) and cfs_rq_has_blocked(), which operates on SMP load-balancing
averages.
To reduce confusion, split these 3 shared uses of 'has_blocked' name
patterns into 3 distinct and greppable patterns:
(1) nohz.has_blocked related functions and variables use
'has_blocked',
(2) rq->has_blocked_load related functions and variables use
'has_blocked_load',
(3) and cfs_rq_has_blocked() uses 'has_blocked_load_avg'.
This patch implements (1) and in _nohz_idle_balance() renames the
'has_blocked_load' local variable to 'has_blocked'.
No change in functionality.
Cc: Shrikanth Hegde <sshegde@...ux.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ff647e92a314..3f21b77b59ce 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -12666,7 +12666,7 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags)
/* Earliest time when we have to do rebalance again */
unsigned long now = jiffies;
unsigned long next_balance = now + 60*HZ;
- bool has_blocked_load = false;
+ bool has_blocked = false;
int update_next_balance = 0;
int this_cpu = this_rq->cpu;
int balance_cpu;
@@ -12710,7 +12710,7 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags)
*/
if (!idle_cpu(this_cpu) && need_resched()) {
if (flags & NOHZ_STATS_KICK)
- has_blocked_load = true;
+ has_blocked = true;
if (flags & NOHZ_NEXT_KICK)
WRITE_ONCE(nohz.needs_update, 1);
goto abort;
@@ -12719,7 +12719,7 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags)
rq = cpu_rq(balance_cpu);
if (flags & NOHZ_STATS_KICK)
- has_blocked_load |= update_nohz_stats(rq);
+ has_blocked |= update_nohz_stats(rq);
/*
* If time for next balance is due,
@@ -12756,7 +12756,7 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags)
abort:
/* There is still blocked load, enable periodic update */
- if (has_blocked_load)
+ if (has_blocked)
WRITE_ONCE(nohz.has_blocked, 1);
}
--
2.51.0
Powered by blists - more mailing lists