From: Joel Granados <joel.granados@kernel.org>
To: Wen Yang <wen.yang@linux.dev>
Cc: Kees Cook <kees@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v5 0/2] sysctl: add CTLTBL_ENTRY_XXX() macros for ctl_table initialization
Date: Mon, 2 Nov 2026 13:23:04 +0100 [thread overview]
Message-ID: <auh_b-jm5yW5ouh5@hobbes> (raw)
In-Reply-To: <6047c828-07a4-449e-aaa6-8fa182c11cba@linux.dev>
[-- Attachment #1: Type: text/plain, Size: 5265 bytes --]
On Sun, Oct 25, 2026 at 12:43:37AM +0800, Wen Yang wrote:
>
>
> On 6/17/26 23:25, Joel Granados wrote:
> > Hey Wen
> >
> > Sorry for not getting back to you sooner.
> >
> > IMO, this is approach is the way to go to bring back the control of the
> > sysctl variables into the sysctl subsys files. Would like to get another
> > set of eyes on it before committing to it though.
> >
> > I think it has not gotten too much attention because it does not touch
> > any other subsystem. Would you consider adding one subsys to the series?
> > Something like implementing it for the users in arch/ or fs/ or
> > drivers/.
> >
> > Also, this might be a signal to park this temporarily and let it simmer
> > until more ppl are annoyed at making changes to the sysctl API.
> >
> > Best
> >
>
> Hi Joel,
>
> Apologies for the long delay, and thank you for your helpful feedback.
>
> I've been tied up with other commitments, but can now return to this
>
> work and prepare v3 based on your suggestions.
>
>
>
> Given the time that has passed, I'd appreciate any updated advice or
>
> related developments I should take into account.
There is now more clarity that the use of MACROS like we had discussed
for this series is probably not the way to go. In [1] it is clear that
the overuse of macros will probably be rejected once it gets upstream.
So for now I would let this implementation go.
Best
[1] https://lore.kernel.org/all/CAHk-=wjUmLrJd4KM4xvJHUN4P0r8oSu5LyvG4JipnhxizBrE9Q@mail.gmail.com
>
>
>
> Thanks again for your time and patience.
>
>
> --
>
> Best regards, Wen
>
> > On Sat, Jun 13, 2026 at 11:56:50PM +0800, Wen Yang wrote:
> > > Hi Kees, H jioel,
> > >
> > > Gentle ping on this series. Please let me know if there are any
> > > concerns or if further changes are needed.
> > >
> > > The series is available at:
> > > https://lore.kernel.org/all/x5stdwwsfp2h22zyexn5ycbxnkyc4ioxscninxsa6q7lf6djqr@jkuppwwqubkp/
> > >
> > > Thanks for your time,
> > > Wen
> > >
> > >
> > > On 3/26/26 02:39, wen.yang@linux.dev wrote:
> > > > From: Wen Yang <wen.yang@linux.dev>
> > > >
> > > > Historically, changes to how struct ctl_table entries are initialized
> > > > (e.g. removing the child field, const-qualifying ctl_table) required
> > > > touching hundreds of files across all subsystems. Such series require
> > > > the attention of many maintainers, sometimes need to be pulled into
> > > > mainline in a special way, and create lots of unnecessary churn. With
> > > > CTLTBL_ENTRY_XXX(), future structural changes to struct ctl_table need
> > > > only update the macro definitions.
> > > >
> > > > Conversion of existing call sites will proceed incrementally from
> > > > kernel/sysctl.c outward, rather than as a treewide sweep.
> > > >
> > > > This series:
> > > > 1. Introduces the CTLTBL_ENTRY_XXX() macros in include/linux/sysctl.h,
> > > > using _Generic() for automatic proc_handler selection, auto
> > > > address-of, auto maxlen via sizeof(), and compile-time validation.
> > > > Supported types: int, unsigned int, long, unsigned long, bool, u8.
> > > > 2. Converts kernel/sysctl-test.c as a demonstration, adding a
> > > > parameterized KUnit test covering all macro variants (V, VM, VMR,
> > > > VN, VNM, VNMH) across int, u8, bool, and char[] types.
> > > >
> > > > Based on discussion and suggestions from:
> > > > [1] https://sysctl-dev-rtd.readthedocs.io/en/latest/notes/ctltable_entry_macro.html
> > > > [2] https://lore.kernel.org/all/psot4oeauxi3yyj2w4ajm3tfgtcsvao4rhv5sgd5s6ymmjgojk@p3vrj3qluban/
> > > >
> > > > ---
> > > > Changes in v5:
> > > > - Extend __CTL_AUTO_HANDLER to support bool and u8
> > > > - Replace individual test functions with a single parameterized KUnit
> > > > test (KUNIT_CASE_PARAM) covering all variants and types
> > > > - Use struct ctl_table as the expected-value container in the param
> > > > struct, eliminating custom expected_* fields
> > > >
> > > > Changes in v4:
> > > > - Fix Wpointer-type-mismatch warnings detected by lkp:
> > > > https://lore.kernel.org/oe-kbuild-all/202603050724.SZxrEyyu-lkp@intel.com/
> > > >
> > > > Changes in v3:
> > > > - Replace the unique macro with "capital letter approach"
> > > > - Reduce the name further
> > > > https://lore.kernel.org/all/rn4rsazh7kxf5byq65vw2phyqgzvwm3scczu3l5h2r4aqit2r6@znlpb24z2zuo/
> > > >
> > > > Changes in v2:
> > > > - Add lvalue check, handler type check, etc.
> > > > https://lore.kernel.org/all/xptwb3uwbzposd4xf7khj52ifv4tchcjdgllhv7aabi6d7wgef@2msurl564v53/
> > > >
> > > >
> > > > Wen Yang (2):
> > > > sysctl: introduce CTLTBL_ENTRY_XXX() helper macros
> > > > sysctl: convert kernel/sysctl-test.c to use CTLTBL_ENTRY_XXX()
> > > >
> > > > include/linux/sysctl.h | 307 +++++++++++++++++++++++++++++++++++++++++
> > > > kernel/sysctl-test.c | 237 ++++++++++++++++++-------------
> > > > kernel/sysctl.c | 2 +
> > > > 3 files changed, 447 insertions(+), 99 deletions(-)
> > > >
> >
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2026-11-02 12:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 18:39 wen.yang
2026-03-25 18:39 ` [RFC PATCH v5 1/2] sysctl: introduce CTLTBL_ENTRY_XXX() helper macros wen.yang
2026-03-25 18:39 ` [RFC PATCH v5 2/2] sysctl: convert kernel/sysctl-test.c to use CTLTBL_ENTRY_XXX() wen.yang
2026-04-07 7:28 ` [RFC PATCH v5 0/2] sysctl: add CTLTBL_ENTRY_XXX() macros for ctl_table initialization Joel Granados
2026-06-13 15:56 ` Wen Yang
2026-06-17 15:25 ` Joel Granados
2026-10-24 16:43 ` Wen Yang
2026-11-02 12:23 ` Joel Granados [this message]
2026-11-02 15:57 ` Wen Yang
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=auh_b-jm5yW5ouh5@hobbes \
--to=joel.granados@kernel.org \
--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®