[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202081304.3103393-1-mingo@kernel.org>
Date: Tue, 2 Dec 2025 09:13:01 +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>
Subject: [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion
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.
While reviewing this code I noticed a couple of inconsistencies:
- nohz.has_blocked sometimes gets handled via a local variable
that is named 'has_blocked_load' - but it's the runqueue
that has the has_blocked_load field, not the nohz structure ...
- The cfs_rq_has_blocked() function does SMP load-balancing and
has no relation to NOHZ has_blocked logic.
- The update_blocked_load_status() function, which sets the
rq->has_blocked_load field, has a parameter named 'has_blocked',
but that's the field name of the nohz structure.
To sort all of this out, standardize on 3 distinct patterns:
(1) nohz.has_blocked related functions and variables use the
'has_blocked' nomenclature,
(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 series implements (1), (2) and (3) via three patches.
The end result becomes a lot more greppable, as the following
'git grep' commands:
git grep 'has_blocked\>' kernel/sched/
git grep 'has_blocked_load\>' kernel/sched/
git grep 'has_blocked_load_avg\>' kernel/sched/
... will now output only the respective relevant lines.
No change in functionality.
Thanks,
Ingo
================
Ingo Molnar (3):
sched/fair: Rename the 'has_blocked_load' local variable to 'has_blocked' in _nohz_idle_balance()
sched/fair: Rename the 'has_blocked' parameter in update_blocked_load_status() to 'has_blocked_load'
sched/fair: Rename cfs_rq_has_blocked() => cfs_rq_has_blocked_load_avg()
kernel/sched/fair.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Powered by blists - more mailing lists