lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtD1ru=naN4bCROM1ioU0nsVht+LJLkhw8rocjFLaR8ZSA@mail.gmail.com>
Date: Tue, 2 Dec 2025 10:04:56 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, 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>, Linus Torvalds <torvalds@...ux-foundation.org>, 
	Mel Gorman <mgorman@...e.de>, Steven Rostedt <rostedt@...dmis.org>, 
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 0/3] sched/fair: Sort out 'blocked_load*' namespace confusion

On Tue, 2 Dec 2025 at 09:13, Ingo Molnar <mingo@...nel.org> wrote:
>
> 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'.

They are all implementing the same feature: update the blocked pelt
signal of idle rqs.

If we want some renaming, we should use the same naming for all to
show that it's all about the same thing

nohz.has_blocked_load()
cfs_rq_has_blocked_load()
rq->has_blocked_load()

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ