Skip to content

kallsyms: Optimize the search for module symbols by livepatch and bpf

Zhen Lei bpf linux-modules linux-trace-kernel live-patching lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3livepatch: Improve the search performance of module_kallsyms_on_each_symbol()include/linux/module.h kernel/livepatch/core.c kernel/module/kallsyms.c +2 more+19 -141 reply
2/3bpf: Optimize get_modules_for_addrs()kernel/trace/bpf_trace.c+40 -6116 replies
3/3kallsyms: Delete an unused parameter related to {module_}kallsyms_on_each_symbol()include/linux/kallsyms.h include/linux/module.h kernel/kallsyms.c +4 more+12 -190 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchPetr Mladek
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] kallsyms: Optimize the search for module symbols by livepatch and bpf

Patches 7-8 in [1] have been delayed until now due to merge conflicts. The current patch 1/3 corresponds to patch 7/9 in [1], and the current patch 3/3 corresponds to patch 8/9 in [1]. But there are some changes. Originally, only livepatch uses function module_kallsyms_on_each_symbol(), it find the specified function for the specified module. Now, bpf also uses function module_kallsyms_on_each_symbol(), it needs to traverse all the modules. So for the new parameter 'modname' of module_kallsyms_on_each_symbol(), if it's NULL, the symbols of all modules are still traversed for compatibility with the case of bpf.

Patch 2/3 is new, as I understand it, it should be fine. If it doesn't work, then patch 3/3 should be dropped.

[1] https://lkml.org/lkml/2022/11/2/225

Zhen Lei (3):
livepatch: Improve the search performance of
module_kallsyms_on_each_symbol()
bpf: Optimize get_modules_for_addrs()
kallsyms: Delete an unused parameter related to
{module_}kallsyms_on_each_symbol()

 include/linux/kallsyms.h   |   3 +-
 include/linux/module.h     |   8 +--
 kernel/kallsyms.c          |   5 +-
 kernel/kallsyms_selftest.c |   6 +--
 kernel/livepatch/core.c    |  13 +----
 kernel/module/kallsyms.c   |  16 ++++--
 kernel/trace/bpf_trace.c   | 101 +++++++++++++++----------------------
 kernel/trace/ftrace.c      |   5 +-
 8 files changed, 67 insertions(+), 90 deletions(-)
Signature · 1 line
2.25.1