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: <aS8DeHzrHS5O4AHj@gmail.com>
Date: Tue, 2 Dec 2025 16:19:20 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, Juri Lelli <juri.lelli@...hat.com>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Valentin Schneider <vschneid@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Shrikanth Hegde <sshegde@...ux.ibm.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 6/6] sched/fair: Rename cfs_rq::avg_vruntime to
 ::sum_w_vruntime, and helper functions


* Peter Zijlstra <peterz@...radead.org> wrote:

> On Mon, Dec 01, 2025 at 07:46:47AM +0100, Ingo Molnar wrote:
> > The ::avg_vruntime field is a  misnomer: it says it's an
> > 'average vruntime', but in reality it's the momentary sum
> > of the weighted vruntimes of all queued tasks, which is
> > at least a division away from being an average.
> > 
> > This is clear from comments about the math of fair scheduling:
> > 
> >     * \Sum (v_i - v0) * w_i := cfs_rq->avg_vruntime
> > 
> > This confusion is increased by the cfs_avg_vruntime() function,
> > which does perform the division and returns a true average.
> > 
> > The sum of all weighted vruntimes should be named thusly,
> > so rename the field to ::sum_w_vruntime. (As arguably
> > ::sum_weighted_vruntime would be a bit of a mouthful.)
> > 
> > Understanding the scheduler is hard enough already, without
> > extra layers of obfuscated naming. ;-)
> > 
> > Also rename related helper functions:
> > 
> >   sum_vruntime_add()    => sum_w_vruntime_add()
> >   sum_vruntime_sub()    => sum_w_vruntime_sub()
> >   sum_vruntime_update() => sum_w_vruntime_update()
> 
> So vruntime := runtime / w, so w*vruntime is runtime again. I'm sure
> there's something there.

Haha, yes. It's delta_exec all the way down, and turtles.

> /me runs.

> But yeah no arguments this naming needs help.
> 
> > With the notable exception of cfs_avg_vruntime(), which
> > was named accurately.
> 
> But the old avg_vruntime() name was good too!

Yeah. It's now restored in its old glory. :-)

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ