public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion
@ 2025-12-02  8:13 Ingo Molnar
  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
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Ingo Molnar @ 2025-12-02  8:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Frederic Weisbecker, Shrikanth Hegde, Juri Lelli,
	Dietmar Eggemann, Valentin Schneider, Vincent Guittot,
	Linus Torvalds, Mel Gorman, Steven Rostedt, Thomas Gleixner,
	Ingo Molnar

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(-)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-12-15  7:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02  8:13 [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion Ingo Molnar
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox