summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2026-09-29 12:07:32 -0600
committerAndrew Morton <akpm@linux-foundation.org>2026-10-08 23:06:54 -0700
commit8822f38fc701da92f42677eb3d4cc4b254e4ecc0 (patch)
treeba6a2f06257c9ea8301f6dd8457d483f4a7934c1 /tools/lib/python/kdoc
parent5611204b0b7928cae7dfc9739706c7f220abdfc8 (diff)
downloadlinux-next-8822f38fc701da92f42677eb3d4cc4b254e4ecc0.tar.gz
linux-next-8822f38fc701da92f42677eb3d4cc4b254e4ecc0.zip
kallsyms: unroll 24-bit sequence reconstruction in get_symbol_seq()
kallsyms_seqs_of_names[] stores 3-byte big-endian sequence indices that map alphabetical symbol positions to address-ordered symbol records. Currently, get_symbol_seq() reconstructs each 24-bit integer using a 3-iteration for-loop that shifts and bitwise-ORs each byte sequentially. During binary search in kallsyms_lookup_names() and duplicate boundary scans, this loop introduces branch and loop overhead on the hot lookup path. Mark get_symbol_seq() as static inline and unroll the 3-byte extraction into direct byte shifts: (p[0] << 16) | (p[1] << 8) | p[2]. This eliminates loop induction variable maintenance and allows the compiler to generate direct loads and constant shifts. Link: https://lore.kernel.org/20260929-ksyms-tune-v7-3-be568ceef41e@gmail.com Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Kees Cook <kees@kernel.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Zhen Lei <thunder.leizhen@huawei.com> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: David Laight <david.laight.linux@gmail.com> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Jiri Olsa <olsajiri@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions