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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CY8PR11MB7134A87E8FA174CED8E144A089632@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Thu, 19 Sep 2024 08:47:46 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Colin King (gmail)" <colin.i.king@...il.com>, "Luck, Tony"
	<tony.luck@...el.com>, Borislav Petkov <bp@...en8.de>, James Morse
	<james.morse@....com>, Mauro Carvalho Chehab <mchehab@...nel.org>, "Robert
 Richter" <rric@...nel.org>, "linux-edac@...r.kernel.org"
	<linux-edac@...r.kernel.org>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH][next] EDAC, pnd2: Make read-only const array intlv static

> From: Colin King (gmail) <colin.i.king@...il.com>
> [...]

> >> -	const int intlv[] = { 10, 11, 12, 12 };
> >> +	static const int intlv[] = { 10, 11, 12, 12 };
> >>
> >
> > I didn't see the why and the benefits of these changes.
> > Could you elaborate more?
> 
> The non-const construct will generate code to put the array on the stack and

Typo? 
s/non-const/non-static/

> this occurs on each call, so there is a small amount of extra object code
> overhead to do this at run time. Making it static will put the data into a data
> section so there is run-time penalty. So this change potentially shrinks the
> object code and run time overhead a very small amount.
> 

Thanks! 

As these are not in hot paths, there should be no measurable performance difference. 

But, I do see that the text size is reduced by 12 bytes [1] after these changes.
Could you add a short description of this benefit in the commit message? 
Other than that,

    Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@...el.com>

[1] $ size pnd2_edac.o.*

   text    data     bss     dec     hex filename
  15632     264    1384   17280    4380 pnd2_edac.o.new
  15644     264    1384   17292    438c pnd2_edac.o.old

- Qiuxu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ