linux-stable/kernel/module
Zhen Lei 07cc2c931e livepatch: Improve the search performance of module_kallsyms_on_each_symbol()
Currently we traverse all symbols of all modules to find the specified
function for the specified module. But in reality, we just need to find
the given module and then traverse all the symbols in it.

Let's add a new parameter 'const char *modname' to function
module_kallsyms_on_each_symbol(), then we can compare the module names
directly in this function and call hook 'fn' after matching. If 'modname'
is NULL, the symbols of all modules are still traversed for compatibility
with other usage cases.

Phase1: mod1-->mod2..(subsequent modules do not need to be compared)
                |
Phase2:          -->f1-->f2-->f3

Assuming that there are m modules, each module has n symbols on average,
then the time complexity is reduced from O(m * n) to O(m) + O(n).

Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230116101009.23694-2-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-01-19 17:07:15 -08:00
..
debug_kmemleak.c
decompress.c module/decompress: Support zstd in-kernel decompression 2022-12-07 12:05:05 -08:00
internal.h dyndbg: gather __dyndbg[] state into struct _ddebug_info 2022-09-07 17:04:48 +02:00
kallsyms.c livepatch: Improve the search performance of module_kallsyms_on_each_symbol() 2023-01-19 17:07:15 -08:00
Kconfig module/decompress: Support zstd in-kernel decompression 2022-12-07 12:05:05 -08:00
kdb.c
livepatch.c
main.c powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
Makefile
procfs.c module: Modify module_flags() to accept show_state argument 2022-07-14 17:40:23 -07:00
signing.c
strict_rwx.c
sysfs.c module: remove redundant module_sysfs_initialized variable 2022-11-11 10:19:52 -08:00
tracking.c module: tracking: Keep a record of tainted unloaded modules only 2022-10-10 12:16:19 -07:00
tree_lookup.c
version.c