mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Joel Granados <joel.granados@kernel.org>
Cc: Kees Cook <kees@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	kernel-dev@igalia.com, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, fsverity@lists.linux.dev,
	keyrings@vger.kernel.org, bpf@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	netdev@vger.kernel.org, linux-wpan@vger.kernel.org,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, linux-sctp@vger.kernel.org,
	linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org,
	bridge@lists.linux.dev, mptcp@lists.linux.dev,
	rds-devel@oss.oracle.com, virtualization@lists.linux.dev
Subject: Re: [PATCH RFC v3 00/13] sysctl: add module aliases
Date: Tue, 15 Sep 2026 21:40:42 -0300	[thread overview]
Message-ID: <cdc75421500371a8839fe5347af5c103@igalia.com> (raw)
In-Reply-To: <uufwu7rqyxf7h55lgavcwrnylnq5gdbd7o5d7mfugrxpblds2d@adra5c2z22gg>

On 2026-09-10 04:29, Joel Granados wrote:
> On Wed, Sep 09, 2026 at 02:29:30PM -0300, Mauricio Faria de Oliveira wrote:
>> On 2026-09-09 11:07, Joel Granados wrote:
>> > On Fri, Sep 04, 2026 at 02:45:23PM -0300, Mauricio Faria de Oliveira wrote:
>> >> On 2026-09-04 10:41, Joel Granados wrote:
>> >> > On Thu, Aug 20, 2026 at 06:22:13PM -0300, Mauricio Faria de Oliveira wrote:
>> >> >> On 2026-08-20 09:51, Joel Granados wrote:
>> >> >> > On Wed, Aug 19, 2026 at 03:16:13PM -0300, Mauricio Faria de Oliveira wrote:
>> >> >> >> This series adds 'sysctl:' aliases to modules that register sysctl tables; e.g.:
>> > <... snip ...>
>> >> > use the correct call moving forward?
>> >>
>> >> This scheme currently covers all modules, AFAIK, as it is wrapped in the
>> >> functions that register sysctl tables.
>> >>
>> >> On moving forward: usage of such functions in a way that breaks a
>> >> requirement of this series (e.g., failing to specify the template
>> >> table/path parameter(s), or not having constant initializers) hits a
>> >> build error, as the requirements are actually from the compiler.
>> >>
>> >> >> I guess that a different design could use MODULE_SYSCTL_TABLE() as
>> >> >> MODULE_DEVICE_TABLE(), declared per table instead of wrapped into
>> >> >> register sysctl functions.
>> >> >> However, it seems to require moving the value of the path argument (or
>> >> >> its template) into the macro and still referencing it in the function
>> >> >> (or its instantiation of the template), which adds obfuscation, to all
>> >> >> callers.
>> >> >>
>> >> >> What do you think?
>> >> > It might be that having it inside the module subsys is more work, but I
>> >> > believe that there is the right place to have it. I still don't see that
>> >> > adding a module specific arg to the sysctl register is a good thing.
>> >>
>> >> Ok, cool. I can work on a different design.
>> >>
>> >> Please just let me know whether you are OK with the remaining (above),
>> >> and I'll be happy to tackle this.
>> >
>> > What is "the remaining"?
>> 
>> I meant the rest of the email, addressing the points/questions you
>> raised.
> 
> * The dependency on a sysctl path to load a module still is
>   backwards to me. It should be: I need feature A, I load modules
>   M{1,2,3} for A and I set sysctl S{1,2,3...}. Not sure why sysctl tools
>   do it the other way around.

Right, but note:
- the feature may, or may not, be built as a module (unknown to sysctl
tool).
- there is no simple way to identify which module provides a sysctl,
today.

Let's compare this with device-id module aliases: userspace doesn't know
whether a driver is built-in or a module, but it can load the module, if
any, based on the device-id, not the module name.

> * The fact that the invariance is in the sysctl path and not the module
>   identifier maybe points to a deeper issue.

It does seem that the invariance in the sysctl path is correct, as that
doesn't change with the variable of whether the code is built-in or a
module.

A similar comparison with device-id module aliases applies, IIUIC.

> * I still believe that this is better placed outside the sysctl
>   subsys as it does not cater solely to module loading.

Understood; your point about a module-specific argument in sysctl
register functions precisely confirmed that this approach is misplaced.

I'll try a different design, more similar to MODULE_DEVICE_TABLE().
Maybe the only requirement from sysctl is for struct
ctl_table.procname's offset to be zero (for file2alias). And apparently
something with the path string in a table declaration macro. We'll see.

Thanks again for reviewing and providing constructive feedback. That's
very appreciated.

> 
> Best

-- 
Mauricio

      reply	other threads:[~2026-09-16  0:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 18:16 Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 01/13] keys, pidns, fs/verity, riscv/vector: reorder '#include <linux/sysctl.h>' Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 02/13] proc: add config option SYSCTL_MODULE_ALIASES Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 03/13] sysctl, mod_devicetable: add macro MODULE_SYSCTL_TABLE Mauricio Faria de Oliveira
2026-08-22 13:41   ` Uwe Kleine-König
2026-08-22 16:57     ` Mauricio Faria de Oliveira
2026-08-23 22:12       ` Uwe Kleine-König
2026-08-24 21:04         ` Mauricio Faria de Oliveira
2026-08-25  8:24           ` Uwe Kleine-König
2026-08-25 19:10             ` Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 04/13] sysctl: add register_sysctl() wrapper for MODULE_SYSCTL_TABLE Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 05/13] sysctl, parport: update register_sysctl() callers with template arguments Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 06/13] sysctl, net: add register_net_sysctl{_sz}() wrappers for MODULE_SYSCTL_TABLE Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 07/13] sysctl, net: update register_net_sysctl{_sz}() callers with template arguments Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 08/13] sysctl, net: update register_net_sysctl_sz(ARRAY_SIZE(table_tmpl)) " Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 09/13] sysctl, ipv6: update register_net_sysctl{_sz}() callers " Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 10/13] sysctl, net: update register_net_sysctl_sz() edge case Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 11/13] sysctl: unrandomize struct ctl_table.procname Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 12/13] modpost: move addend_*_rel() calls into addend_rel() Mauricio Faria de Oliveira
2026-08-19 18:16 ` [PATCH RFC v3 13/13] modpost: handle MODULE_SYSCTL_TABLE symbols Mauricio Faria de Oliveira
2026-08-20 12:51 ` [PATCH RFC v3 00/13] sysctl: add module aliases Joel Granados
2026-08-20 21:22   ` Mauricio Faria de Oliveira
2026-09-04 13:41     ` Joel Granados
2026-09-04 17:45       ` Mauricio Faria de Oliveira
2026-09-09 14:07         ` Joel Granados
2026-09-09 17:29           ` Mauricio Faria de Oliveira
2026-09-10  7:29             ` Joel Granados
2026-09-16  0:40               ` Mauricio Faria de Oliveira [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=cdc75421500371a8839fe5347af5c103@igalia.com \
    --to=mfo@igalia.com \
    --cc=bpf@vger.kernel.org \
    --cc=bridge@lists.linux.dev \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fsverity@lists.linux.dev \
    --cc=horms@kernel.org \
    --cc=joel.granados@kernel.org \
    --cc=kees@kernel.org \
    --cc=kernel-dev@igalia.com \
    --cc=keyrings@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nsc@kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rds-devel@oss.oracle.com \
    --cc=virtualization@lists.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®