mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Granados <joel.granados@kernel.org>
To: Wen Yang <wen.yang@linux.dev>
Cc: David Laight <david.laight.linux@gmail.com>,
	 Kees Cook <kees@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 0/6] sysctl: replace overloaded extra pointers with typed bounds and core stride
Date: Thu, 26 Nov 2026 13:30:53 +0100	[thread overview]
Message-ID: <awgj9tL-yAMS14zy@hobbes> (raw)
In-Reply-To: <0e4be7f5-8704-4d2c-8e63-d578fad13774@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 3848 bytes --]

On Thu, Nov 26, 2026 at 01:37:12AM +0800, Wen Yang wrote:
> 
> 
> On 11/24/26 21:26, Joel Granados wrote:
> > On Tue, Nov 17, 2026 at 12:07:32AM +0800, wen.yang@linux.dev wrote:
> > > From: Wen Yang <wen.yang@linux.dev>
> > Thx for taking the time to put this out. This gives perspective and adds
> > to the discussion of how best to move forward with "struct ctl_table".
> > 
> > > 
<... snip ...>
> > > 1. Abandoned per-entry 'void *priv' (David Laight):
> > Though not adding yet another entry in ctl_table is commendable, I
> > prefer adding a priv entry over the stride mechanism in this series.
> > Here are my thoughts:
> > 
> > 1. The type should set the stride in sysctl core. The situation where
> >     the stride of a type might be different from its size should be avoided.
> >     In these cases I would prefer a whole new type.
> > 
> > 2. Having ctl_table as the grounding entry inside another struct and, at
> >     the same time, it be a regular (non-grounding) entry is asking for
> >     trouble.
> >     - A proc_handler assumes there is a containing entry around only to
> >       realize that it was passed just a pointer.
> >     - The core might start overlaying clt_table entries to deal with
> >       namespaces [1], [2], [3]
> > 
> > >     - v1 added 'priv' to struct ctl_table, incurring 8 bytes on 64-bit and
> > >       4 bytes on 32-bit for all ~1,000 entries across thousands of dynamic
> > >       instances, even though <7% of entries need context.
> > Just a quick comment here: If you want to get rid of 8/4 bytes with the
> > ctl_table struct, you might want to look at struct ctl_table_poll, which
> > (to my knowledge) is only used in one ctl_table array. Finding a way to
> > service utsname while at the same time removing that entry is much more
> > of a low hanging fruit IMO.
> > 
> 
> Hi Joel,
> 
> Thanks for the detailed feedback and the namespace overlay pointers.
FYI, I just sent out a new RFC [1] which has very little overlap (and we
should try to keep it that way) with your work here.

> 
> Our main motivation for prototyping the stride approach (and the v3 we
> have been testing) was to avoid growing struct ctl_table while still
> eliminating the per-entry wrapper functions. However, the upcoming
> namespace table overlay work is a compelling reason to keep ctl_table
> arrays homogeneous and  self-contained.
> 
> Following your advice, we will set the stride series aside and split the
> work into focused steps:
> 
> 1, first, prepare a small, standalone series (based on the lastest -rc)
>    focused on migrating the non-bound context callers of extra1/extar2
>    to a dedicated void *priv, field in struct ctl_table, without
>    touching any min/max bounds yet.
Yes. That will take us to a place where we will have priv and extra{1,2}
at the same time. But will allow us to move the callers one by one.

Once all the callers are updated, we can eliminate/replace the
extra{1,2} as there is not other dependencies (that I know of)

> 
> 2, Once the context pointer migration is settled, follow up with the
>    typed min/max bound conversion as a separate series.
ACK

> 
> Regarding struct ctl_table_poll in utsname: is someone already working
> on removing it from struct ctl_table, or would you like us to look into
> that as a separate cleanup as well?
No one is working on it to my knowledge. If you can come up with a way
to keep the poll without having it in ctl_table, that would be a win.

> 
> We expect to have the context-pointer series ready in about 1 week.
> Please let me know if you have any preferences or suggestions on this plan.
That sounds good to me.


> 
> Thanks,
> Wen
> 

[1] https://lore.kernel.org/20261126-lklm-sysctl-ctx-flatarray-v1-0-d7fc9cc9b03e@kernel.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

      reply	other threads:[~2026-11-26 12:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:07 wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 1/5] sysctl: add numeric bounds and core stride infrastructure wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 2/5] sysctl: cover numeric bounds and table containers in KUnit wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 3/5] netfilter: embed logger sysctl context using stride wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 4/5] net/ipv4: embed device " wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 5/5] scripts/coccinelle: add script to detect and convert sysctl bounds wen.yang
2026-11-16 21:40 ` [RFC PATCH v2 0/6] sysctl: replace overloaded extra pointers with typed bounds and core stride David Laight
2026-11-17 17:01   ` Wen Yang
2026-11-17 18:10     ` David Laight
2026-11-24 13:26 ` Joel Granados
2026-11-25 17:37   ` Wen Yang
2026-11-26 12:30     ` Joel Granados [this message]

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=awgj9tL-yAMS14zy@hobbes \
    --to=joel.granados@kernel.org \
    --cc=david.laight.linux@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wen.yang@linux.dev \
    /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®