lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQkSnZ1nVXiZH9kg52H-A_=urcsv-W7wGXvunMGhGX8Vw@mail.gmail.com>
Date: Tue, 16 Jul 2024 05:12:24 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Zheng Yejian <zhengyejian1@...wei.com>
Cc: rostedt@...dmis.org, mhiramat@...nel.org, mark.rutland@....com, 
	mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu, 
	naveen.n.rao@...ux.ibm.com, tglx@...utronix.de, mingo@...hat.com, 
	bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com, 
	mcgrof@...nel.org, mathieu.desnoyers@...icios.com, nathan@...nel.org, 
	nicolas@...sle.eu, kees@...nel.org, james.clark@....com, 
	kent.overstreet@...ux.dev, yhs@...com, jpoimboe@...nel.org, 
	peterz@...radead.org, linux-kernel@...r.kernel.org, 
	linux-trace-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, 
	linux-modules@...r.kernel.org, linux-kbuild@...r.kernel.org, 
	bpf@...r.kernel.org
Subject: Re: [PATCH 1/6] kallsyms: Optimize multiple times of realloc() to one
 time of malloc()

On Thu, Jun 13, 2024 at 10:36 PM Zheng Yejian <zhengyejian1@...wei.com> wrote:
>
> Array 'table' is used to store pointers of symbols that read from in.map
> file, and its size depends on the number of symbols. Currently 'table'
> is expanded by calling realloc() every 10000 symbols read.
>
> However, there generally are around 100000+ symbols, which means that
> the expansion is generally 10+ times.
>
> As an optimization, introduce linked list 'sym_list' to associate and
> count all symbols, then store them into 'table' at one time.
>
> Signed-off-by: Zheng Yejian <zhengyejian1@...wei.com>


I do not think this is worthwhile.

realloc() is simple.

If this is a problem, you can increase the
"+= 10000" to "+= 65536" or something.







-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ