]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kallsyms: Reduce the memory occupied by kallsyms_seqs_of_names[]
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 2 Nov 2022 08:49:16 +0000 (16:49 +0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Sun, 13 Nov 2022 02:47:36 +0000 (18:47 -0800)
commit19bd8981dc2ee35fdc81ab1b0104b607c917d470
treef6aa4bb086792556d242c82f7f6810296705d499
parent010a0aad39fccceba4a07d30d163158a39c704f3
kallsyms: Reduce the memory occupied by kallsyms_seqs_of_names[]

kallsyms_seqs_of_names[] records the symbol index sorted by address, the
maximum value in kallsyms_seqs_of_names[] is the number of symbols. And
2^24 = 16777216, which means that three bytes are enough to store the
index. This can help us save (1 * kallsyms_num_syms) bytes of memory.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/kallsyms.c
kernel/kallsyms_internal.h
scripts/kallsyms.c