From: Ingo Molnar <mingo@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <frederic@kernel.org>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Juri Lelli <juri.lelli@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Valentin Schneider <vschneid@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion
Date: Tue, 2 Dec 2025 09:13:01 +0100 [thread overview]
Message-ID: <20251202081304.3103393-1-mingo@kernel.org> (raw)
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(-)
next reply other threads:[~2025-12-02 8:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 8:13 Ingo Molnar [this message]
2025-12-02 8:13 ` [PATCH 1/3] sched/fair: Rename the 'has_blocked_load' local variable to 'has_blocked' in _nohz_idle_balance() Ingo Molnar
2025-12-02 8:13 ` [PATCH 2/3] sched/fair: Rename the 'has_blocked' parameter in update_blocked_load_status() to 'has_blocked_load' Ingo Molnar
2025-12-02 8:13 ` [PATCH 3/3] sched/fair: Rename cfs_rq_has_blocked() => cfs_rq_has_blocked_load_avg() Ingo Molnar
2025-12-02 9:04 ` [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion Vincent Guittot
2025-12-02 9:34 ` [PATCH 1/1 -v2] sched/fair: Sort out 'blocked_load*' namespace noise Ingo Molnar
2025-12-02 10:13 ` Vincent Guittot
2025-12-02 16:09 ` [PATCH 1/1 -v3] " Ingo Molnar
2025-12-02 16:55 ` Vincent Guittot
2025-12-02 20:26 ` Shrikanth Hegde
2025-12-14 7:46 ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2025-12-15 7:59 ` tip-bot2 for Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251202081304.3103393-1-mingo@kernel.org \
--to=mingo@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=frederic@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sshegde@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox