On 9/11/26 4:40 PM, Petr Pavlu wrote:
> linux/module.h appears in roughly 15k #include directives across the
> kernel. This makes it a "hot" header, so it should avoid pulling in
> unnecessary definitions.
> 
> The header currently includes linux/elf.h but this is largely unnecessary
> because it requires only the base ELF structures, such as Elf_Ehdr and
> Elf_Sym, which are declared in uapi/linux/elf.h.
> 
> Replace the linux/elf.h include with uapi/linux/elf.h. On x86_64_defconfig,
> including linux/module.h alone results in 2.2 MB of preprocessed data. This
> change reduces that to 1.5 MB.
> 
> The first five patches are cleanups to avoid relying on declarations being
> indirectly provided through linux/module.h -> linux/elf.h. These patches
> are mostly independent and can go through their respective trees if
> preferred, except for the cpufeature patch, which depends on the preceding
> s390 cleanup. The final module patch depends on all of these changes.
> 
> It is hard to identify all files that indirectly reference something only
> through linux/module.h -> linux/elf.h. The changes were build-tested with
> allmodconfig on arm, arm64, m68k, mips, powerpc64, riscv, s390, x86_64.

I plan to pick up this series on modules-next by the end of the week.
Acked-by tags from the relevant maintainers would be appreciated.

-- 
Thanks,
Petr

Reply via email to