mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Theodore Tso <tytso@mit.edu>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sasha Levin <sashal@kernel.org>,
	Gabriele Paoloni <gpaoloni@redhat.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Chuck Wolber <chuckwolber@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Chris Mason <clm@meta.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Follow-up on Linux-kernel code accessibility
Date: Sat, 27 Dec 2025 15:28:38 -0800	[thread overview]
Message-ID: <cf17f9ed-f506-46bb-b4d1-2ef89ca8daae@paulmck-laptop> (raw)
In-Reply-To: <b6c33ada-5141-c999-d038-e815d21b978a@inria.fr>

On Sat, Dec 27, 2025 at 07:16:28AM +0100, Julia Lawall wrote:
> 
> 
> On Fri, 26 Dec 2025, Paul E. McKenney wrote:
> 
> > On Fri, Dec 26, 2025 at 02:22:17PM -0500, Theodore Tso wrote:
> > > On Fri, Dec 26, 2025 at 11:48:30AM -0500, Steven Rostedt wrote:
> > > > Agreed, but knowing what the function is doing should give you some idea of
> > > > how it is doing it.
> > > >
> > > >   "Loop doing repeated quiescent-state forcing until the grace period ends."
> > > >
> > > > Is the only description of "what the function is doing", but it gives you
> > > > no clue to why it's using those magic numbers. There should be comments
> > > > about how the magic numbers relate to the what.
> > >
> > > Sure, but rcu_gp_fqs_loop() is a static, internal function.  I agree
> > > that better documentation would be usefui for people who want to
> > > modify the internals of the RCU infrastructure, but it's not something
> > > that should be in kernel documentation for newcomers to kernel
> > > development.
> > >
> > > When we talk about making the kernel code more accessible, it's really
> > > important to keep in mind that different audiences may have different
> > > needs, and too much information can be just as confusing as too
> > > little.  It seems likely that most newcomers aren't going to be
> > > looking to make changes to important systems like RCU.
> > >
> > > That being said, even though most newcomers aren't probably going to
> > > be making changes to file systems, as a file system maintainer I
> > > admittedly to have a vested interest in making easier for
> > > intermediate-level kernel developers who might take an interest to
> > > ext4 development to have an easy path to do so.  So I get where Paul
> > > is coming from.
> > >
> > > When we're talking about making the kernel code more accessible, we
> > > need need to be very explicit about which target audiences we are
> > > targetting, because the strategies might be different for different
> > > readers.
> >
> > Here is how I group them:
> >
> > 1.	RCU users in the Linux kernel.	Largish group.	Addressed by much
> > 	of the Documentation/RCU contents, the occasional LWN article,
> > 	blog posts, and by RCU experts in various subsystems.
> >
> > 2.	RCU users in userspace.  Modest group, but growing.  LWN articles,
> > 	blog posts, an academic paper or three, and a number of people
> > 	who have implemented some form or another of RCU.
> >
> > 3.	Userspace RCU implementations.  Smallish group, but there are
> > 	quite a few implementations out there.  I don't deliberately
> > 	target anything to this group, but it is quite possible that
> > 	some of the writings for the other groups have been helpful.
> >
> > 4.	Linux-kernel RCU implementation.  Small group, though a largish
> > 	one if we include all the people who have gotten at least one
> > 	patch accepted.  Comments, Linux-kernel RCU Design Documents [1],
> > 	Documentation/RCU/Design, a few LWN articles, a few blog posts,
> > 	and the several regular developers and maintainers.
> >
> > And I would like to think that Section 9.5 of "Is Parallel Programming
> > Hard, And, If So, What Can You Do About It?" [2] has been helpful.
> >
> > What groups should I be adding?
> 
> In the case of the scheduler, I observe some unexpected behavior, and then
> I have the feeling that I backtrack through the code coming from a
> direction that was not anticipated by the person who wrote the comments
> (sometimes inline comments, more likely the comments in the commit tht
> introduced the line I am wondering about).  But I'm not sure how to place
> RCU.  My impression is that it has a more monolithic implementation, and
> that I would only ever consider it to be a block box, not something I
> would debug my way into.  But perhaps people felt that way about the
> scheduler functions I am looking at as well.  Over time, there have surely
> been performance improvements in RCU as well.  It seems hard to anticipate
> what information people will need.

Although RCU does use heuristics, I would say that its operation adapts
less to dynamic conditions than does the scheduler.  RCU is mostly an
observer of state, while the scheduler's job is mostly a controller
of state.

> Maybe one could consider that division by a constant is sufficiently rare
> in the kernel that it should always be documented?

If it is (for example) division by 10 in code that converts binary
integers to char, or code computing an average, I would not expect a
comment to be needed.

But I do feel the need to ask what division you are referring to.  ;-)

							Thanx, Paul

> julia
> 
> 
> 
> >
> > 							Thanx, Paul
> >
> > [1] https://docs.google.com/document/d/1GCdQC8SDbb54W1shjEXqGZ0Rq8a6kIeYutdSIajfpLA/edit?pli=1&tab=t.0#heading=h.ytgz5i5df43s
> >
> > [2] https://www.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html
> >

  reply	other threads:[~2025-12-27 23:28 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 19:49 Paul E. McKenney
2025-12-18 22:09 ` David Laight
2025-12-19  0:20   ` Paul E. McKenney
2025-12-19  6:51 ` Julia Lawall
2025-12-19 17:09   ` Theodore Tso
2025-12-19 17:59     ` Sasha Levin
2025-12-19 18:28       ` Steven Rostedt
2025-12-20  0:36         ` Paul E. McKenney
2025-12-22 15:42           ` Steven Rostedt
2025-12-23 23:46             ` Paul E. McKenney
2025-12-24 14:11               ` Steven Rostedt
2025-12-25 15:03                 ` Theodore Tso
2025-12-25 18:22                   ` Paul E. McKenney
2025-12-26 16:48                   ` Steven Rostedt
2025-12-26 18:44                     ` Paul E. McKenney
2025-12-26 19:22                     ` Theodore Tso
2025-12-26 20:35                       ` Steven Rostedt
2025-12-27  1:04                       ` Paul E. McKenney
2025-12-27  6:16                         ` Julia Lawall
2025-12-27 23:28                           ` Paul E. McKenney [this message]
2025-12-27 23:32                             ` Julia Lawall
2025-12-28  1:26                               ` Paul E. McKenney
2025-12-28  1:48                                 ` Dr. David Alan Gilbert
2025-12-28  5:16                                   ` Paul E. McKenney
2025-12-28  9:36                                     ` Julia Lawall
2025-12-29 15:40                                       ` Steven Rostedt
2025-12-29 16:16                                         ` Paul E. McKenney
2025-12-29 17:02                                           ` Dr. David Alan Gilbert
2025-12-29 17:37                                             ` Paul E. McKenney
2025-12-29 18:10                                               ` Dr. David Alan Gilbert
2025-12-29 18:59                                                 ` Paul E. McKenney
2025-12-29 20:35                                                   ` Steven Rostedt
2025-12-29 22:05                                                     ` Dr. David Alan Gilbert
2026-01-09  1:35                                                       ` Paul E. McKenney
2026-01-09  1:34                                                     ` Paul E. McKenney
2026-01-09 14:58                                                       ` Steven Rostedt
2026-01-09 18:31                                                         ` Paul E. McKenney
2026-01-11  3:30                                                         ` Theodore Tso
2026-01-11 17:11                                                           ` Steven Rostedt
2026-01-12  5:06                                                             ` Paul E. McKenney
2026-01-12  7:05                                                               ` Julia Lawall
2026-01-12 16:57                                                                 ` Paul E. McKenney
2025-12-29 23:50                                                   ` Theodore Tso
2025-12-30  0:19                                                     ` Steven Rostedt
2025-12-30  0:34                                                       ` Steven Rostedt
2026-01-09  2:23                                                     ` Paul E. McKenney
2025-12-28 12:46                                     ` Dr. David Alan Gilbert
2025-12-29  0:03                                       ` Paul E. McKenney
2025-12-25 18:18                 ` Paul E. McKenney
2025-12-26 16:51                   ` Steven Rostedt
2025-12-26 18:36                     ` Paul E. McKenney
2025-12-19 21:05     ` Chris Mason
2025-12-20  4:00       ` Theodore Tso
2026-01-06 18:08       ` Lorenzo Stoakes
2026-01-13 13:03         ` Chris Mason
2025-12-20  0:31   ` Paul E. McKenney
2026-01-06 18:05 ` Lorenzo Stoakes
2026-01-09  1:40   ` Paul E. McKenney

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=cf17f9ed-f506-46bb-b4d1-2ef89ca8daae@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=chuckwolber@gmail.com \
    --cc=clm@meta.com \
    --cc=dvyukov@google.com \
    --cc=gpaoloni@redhat.com \
    --cc=julia.lawall@inria.fr \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mark.rutland@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=sashal@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®