From: Petr Pavlu <petr.pavlu@suse.com>
To: Jim Cromie <jim.cromie@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Daniel Gomez <da.gomez@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Aaron Tomlin <atomlin@atomlin.com>,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] module: speed modprobe by adding name_crc to struct module
Date: Fri, 23 Jan 2026 10:36:20 +0100 [thread overview]
Message-ID: <198d1ca0-031f-459c-89bd-6d438a84fcb9@suse.com> (raw)
In-Reply-To: <20260122234621.3403276-1-jim.cromie@gmail.com>
On 1/23/26 12:46 AM, Jim Cromie wrote:
> "modprobe foo" currently does strcmp on the name, this can be improved.
>
> So this commit:
>
> 1. adds name_crc to struct module
> 2. modpost.c computes the value and
> 3. outputs it for "modinfo foo" to see/use.
>
> 4. adds hotpath to find_module_all()
> this uses name_crc to do quick "name-check"
> falls back to strcmp only to guard against collisions.
>
> This should significantly reduce modprobe workload, and shorten module
> load-time.
>
> Since it alters struct module, its binary incompatible. This means:
>
> 1. RFC for its wide "blast radius".
> 2. suitable for major version bump *only*
>
> 3. it opens door for further struct module reorg, to:
> a. segregate fields by "temperature"
> b. pack out paholes.
> c. improve cache locality (by reordering coldest on bottom)
> name should be cold now.
> bikeshedding is appropriate here.
>
> NB: this isn't a substitute for CONFIG_MODULE_SIG.
> It reimplements crc_le(), doesn't reuse kernel's version.
>
> CC: Luis Chamberlain <mcgrof@kernel.org>
> CC: Petr Pavlu <petr.pavlu@suse.com>
> CC: Daniel Gomez <da.gomez@kernel.org>
> CC: Sami Tolvanen <samitolvanen@google.com>
> CC: Aaron Tomlin <atomlin@atomlin.com>
> CC: linux-modules@vger.kernel.org
>
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
>
> '#' will be ignored, and an empty message aborts the commit.
This patch looks as if it were generated by AI. If so, please avoid
sending such changes. Otherwise, the commit description should explain
the affected workload. This should be backed up by actual measurements,
showing how the change improves the situation.
Implementation-wise, I don't think this is the right approach. If
searching by a module name is a hot operation, a hash table can be added
to speed it up.
--
Cheers,
Petr
next prev parent reply other threads:[~2026-01-23 9:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 23:46 [RFC PATCH 1/1] module: speed modprobe by adding name_crc to struct module Jim Cromie
2026-01-23 9:36 ` Petr Pavlu [this message]
2026-01-23 10:31 ` Daniel Gomez
2026-01-23 23:33 ` jim.cromie
2026-01-23 11:39 ` Christophe Leroy (CS GROUP)
2026-01-23 23:10 ` jim.cromie
2026-01-23 23:24 ` jim.cromie
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=198d1ca0-031f-459c-89bd-6d438a84fcb9@suse.com \
--to=petr.pavlu@suse.com \
--cc=atomlin@atomlin.com \
--cc=da.gomez@kernel.org \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=samitolvanen@google.com \
/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