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: <c5f082e3-5923-4965-8e4a-3281258d3634@paulmck-laptop>
Date: Mon, 29 Dec 2025 08:16:55 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Julia Lawall <julia.lawall@...ia.fr>,
	"Dr. David Alan Gilbert" <dave@...blig.org>,
	Theodore Tso <tytso@....edu>, Sasha Levin <sashal@...nel.org>,
	Gabriele Paoloni <gpaoloni@...hat.com>,
	Kate Stewart <kstewart@...uxfoundation.org>,
	Chuck Wolber <chuckwolber@...il.com>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	Mark Rutland <mark.rutland@....com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	Shuah Khan <skhan@...uxfoundation.org>, Chris Mason <clm@...a.com>,
	linux-kernel@...r.kernel.org
Subject: Re: Follow-up on Linux-kernel code accessibility

On Mon, Dec 29, 2025 at 10:40:05AM -0500, Steven Rostedt wrote:
> On Sun, 28 Dec 2025 10:36:39 +0100 (CET)
> Julia Lawall <julia.lawall@...ia.fr> wrote:
> 
> > > > > > j = (j + 2) / 3;  
> > > > >
> > > > > "Divide by three rounding up."  
> 
> That's as useful as:
> 
> 	/* Add one to X */
> 	x++;
> 
> > > >
> > > > That's not *that* obvious, but ok, but then why 3?
> > > >
> 
> Bingo! You win a cigar! :-)
> 
> I know that was a round up (and yes, as David pointed out, we have macros
> for that too). The question is why are you dividing it by 3? I don't see
> anything in that function which suggests the reason for needing to divide j
> by 3.
> 
> If the comments you were adding in the past was things like "Divide by
> three rounding up" then yeah, I can see why people would say you have too
> many comments. The comments are not to be discussing what is being done,
> but why is it being done.
> 
> 			WRITE_ONCE(rcu_state.jiffies_kick_kthreads,
> 				   jiffies + (j ? 3 * j : 2));
> 
> 
> Why the: (j ? 3 * j : 2) ?
> 
> Why is 3 so magical?
> 
> 			/*
> 			 * j is the Father, Son and Holy Ghost.
> 			 * But only one may be active at a time.
> 			 * They each take a third. Father is first,
> 			 * Son is second, and Holy Ghost is third.
> 			 */
> 			j = (j + 2) / 3;
> 
> 			/*
> 			 * j may not be zero, as that would lead to
> 			 * damnation. 
> 			 */
> 			if (j <= 0)
> 				j = 1;

I would of course nack that comment, amusing though it might be to track
others' reactions to it over time.  ;-)

So you are now unwilling to do a walkthrough?  That would be unfortunate.

If your view is that I should just answer the question so that
everyone can get on with life, please keep in mind that there are some
tens of thousands of other lines of code in Linux-kernel RCU.  It is
therefore only reasonable that I insist upon a more organized approach.
In addition, as noted earlier [1], you guys are members of one of the
smaller audiences that need my assistance.  Plus you were on CC for the
patch that added this line.  ;-)

On the other hand, if your view is instead that because the three of
you don't immediately grok this line of code, I should be willing to
take hundreds of lines of LLM-generated comments for each and every
non-trivial RCU function (for some TBD definition of "non-trivial"),
sorry, but no, that does not follow.

							Thanx, Paul

[1] https://lore.kernel.org/all/fe8c7e28-b5fe-4411-b27c-b2efd89a74c7@paulmck-laptop/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ