Re: [PATCH v2] genksyms: Support arm64 CRC32 hardware acceleration1~
From: Wentao Guan
Date: Tue May 26 2026 - 15:15:06 EST
Hello Petr,
> On 5/25/26 3:41 PM, Wentao Guan wrote:
> >> On 5/25/26 10:02 AM, Wentao Guan wrote:
> >>>> Additionally, many distributions already switched to gendwarfksyms last
> >>>> year. Unless someone provides a good reason to keep genksyms around,
> >>>> I expect it will be deprecated soon and eventually removed. It would be
> >>>> more valuable to show whether the same optimization is worthwhile for
> >>>> gendwarfksyms.
> >>> I see gendwarfksyms use crc32 from <zlib.h>, which from zlib1g-dev and zlib1g.
> >>
> >> Ah, I forgot about this, so gendwarfksyms should already be well
> >> optimized. I think that is the most important thing.
> >
> > Which way do you prefer? There are two ways now:
> > 1. this work,
> > 2. import zlib like gendwarfksyms and remove the huge crctab,
> > but need make sure any arch do not cause performance regression?
> > (Assert the user libs precompile with +crc32 is right?)
> > I do some early tests show that:
> > 1) zlib in x86 fast than genksym software
> > 2) zlib in arm64 debian precompile slow than genksym software(crc32 not in armv8)
> > 3) zlib in arm64 recompile with +crc32 same speed with genksyms hardware
>
> I think it would be useful to first have more data showing that the CRC
> calculation in genksyms is a hot path and contributes significantly to
> the overall kernel build time.
I found that 'nm' is slow and a really crazy but significantly improve my build speed,
from 11m50s down to 11m18s:
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0c838c467..d5b9db6d3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -231,7 +231,7 @@ ifdef CONFIG_MODVERSIONS
# be compiled and linked to the kernel and/or modules.
gen_symversions = \
- if $(NM) $@ 2>/dev/null | grep -q ' __export_symbol_'; then \
+ if strings $@ 2>/dev/null | grep -q '__export_symbol_'; then \
$(cmd_gensymtypes_$1) >> $(dot-target).cmd; \
fi
BRs
Wentao Guan