[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d059c054-1ef9-f89b-fcb2-7387770d2ec7@huawei.com>
Date: Wed, 2 Nov 2022 17:18:25 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To: Luis Chamberlain <mcgrof@...nel.org>
CC: Josh Poimboeuf <jpoimboe@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
<live-patching@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
<linux-modules@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Ingo Molnar" <mingo@...hat.com>
Subject: Re: [PATCH v7 00/11] kallsyms: Optimizes the performance of lookup
symbols
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
Powered by blists - more mailing lists