[PATCH 13/23] modpost: hash module source per-file, not per-byte

Lorenzo Stoakes (ARM) ljs at kernel.org
Fri Sep 11 03:41:43 PDT 2026


On Thu, Sep 10, 2026 at 02:52:50PM +0200, Petr Pavlu wrote:
> On 9/8/26 10:55 PM, Lorenzo Stoakes (ARM) wrote:
> > modpost spends a long time md4 hashing module source at a per-byte
> > granularity.
> >
> > Fix this by doing this hashing per-file instead by accumulating a per-file
> > buffer in parse_file().
> >
> > All 11,189 .mod.c files and Module.symvers were confirmed to be identical
> > with this change applied.
> >
> > This is especially impactful for allmodconfig incremental builds (where
> > CONFIG_MODULE_SRCVERSION_ALL is set).
> >
> > Whole build, 128-thread Threadripper 9980X, best of N runs:
> >
> >                                          before   after     delta
> >                                          -------------------------------
> >   x86 allmodconfig, touch mm/vma.c, gcc    40.6s    38.2s     -2.4s (-6%)
> >   x86 allmodconfig, touch mm/vma.c, clang  36.2s    35.0s     -1.2s (-3%)
> >
> > Assisted-by: LLM
> > Signed-off-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
> > ---
> >  scripts/mod/sumversion.c | 56 +++++++++++++++++++++++++++++++++++++-----------
> >  1 file changed, 44 insertions(+), 12 deletions(-)
>
> Support for the module srcversion is being removed in "module: remove
> MODULE_VERSION() and srcversion" [1] and scripts/mod/sumversion.c should
> be gone completely.

Hmm, that series doesn't remove the script though, is that planned as a follow up?

I guess I can drop this patch from the series then :) Also patch 17 I think?

>
> [1] https://lore.kernel.org/linux-modules/20260731-module_ver_remove-v2-0-c9163858f382@linuxfoundation.org/
>
> --
> Thanks,
> Petr

--
Cheers, Lorenzo



More information about the linux-riscv mailing list