[PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion
From: Ingo Molnar
Date: Tue Dec 02 2025 - 03:14:02 EST
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(-)