lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 00/11] kallsyms: Optimizes the performance of lookup symbols
From
Date


On 2022/10/31 23:04, Leizhen (ThunderTown) wrote:
> Now, we need to make a decision. Choose one of the two:
> 1. Continue with my current approach. Improve the average performance of
> kallsyms_lookup_name() by 20 to 30 times. The memory overhead is increased by:
> arm64 (defconfig):
> 73.5KiB and 4.0% if CONFIG_KALLSYMS_ALL=y.
> 19.8KiB and 2.8% if CONFIG_KALLSYMS_ALL=n.
> x86 (defconfig):
> 49.0KiB and 3.0% if CONFIG_KALLSYMS_ALL=y.
> 16.8KiB and 2.3% if CONFIG_KALLSYMS_ALL=n.
> 2. Sort names, binary search (The static function causes duplicate names. Additional work is required)
> 2^18=262144, only up to 18 symbol expansions and comparisons are required.
> The performance is definitely excellent, although I haven't tested it yet.
> The memory overhead is increased by: 6 * kallsyms_num_syms
> arm64 (defconfig):
> 1MiB if CONFIG_KALLSYMS_ALL=y.
> 362KiB if CONFIG_KALLSYMS_ALL=n.
> x86 (defconfig):
> 770KiB if CONFIG_KALLSYMS_ALL=y.
> 356KiB if CONFIG_KALLSYMS_ALL=n.

Hi, Luis:
I've implemented v8 based on method 2(Sort names, binary search).
The memory overhead is increased by: 3 * kallsyms_num_syms.
kallsyms_offsets_of_names[] is not added in v8 because it does not help
much in performance improvement, so save (3 * kallsyms_num_syms) bytes.
For details about the performance data, please see the commit message.


--
Regards,
Zhen Lei

\
 
 \ /
  Last update: 2022-11-02 10:22    [W:0.205 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site