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: <20e5a0db0ebf4bbb991b13a1d8951137@AcuMS.aculab.com>
Date: Fri, 26 Jul 2024 21:32:43 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Torvalds' <torvalds@...uxfoundation.org>, Lorenzo Stoakes
	<lorenzo.stoakes@...cle.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Matthew
 Wilcox (Oracle)" <willy@...radead.org>, Christoph Hellwig
	<hch@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>, "Andy
 Shevchenko" <andriy.shevchenko@...ux.intel.com>, Dan Carpenter
	<dan.carpenter@...aro.org>, Arnd Bergmann <arnd@...nel.org>,
	"Jason@...c4.com" <Jason@...c4.com>, "pedro.falcato@...il.com"
	<pedro.falcato@...il.com>, Mateusz Guzik <mjguzik@...il.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: RE: [PATCH 0/7] minmax: reduce compilation time

From: Linus Torvalds
> Sent: 26 July 2024 19:24
> 
> On Fri, 26 Jul 2024 at 11:13, Lorenzo Stoakes
> <lorenzo.stoakes@...cle.com> wrote:
> >
> > 5,447,539       ./arch/x86/xen/setup.o.pre
> 
> Can you perhaps do some kind of "max expansion" on all the
> preprocessor files (you seem to have done it by changing the ".c.o"
> rule to just spit it out as "o.pre", which sounds fine).
> 
> For example, this trivial patch seems to fix the setup.c expansion by
> about an order of magnitude (ie 50M -> 5M).
> 
> Entirely untested, but looks ObviouslyCorrect(tm) to me.

-	extra_pages = min3(EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)),
-			   extra_pages, max_pages - max_pfn);
+	maxmem_pages = EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM));
+	extra_pages = min3(maxmem_pages, extra_pages, max_pages - max_pfn);

I suspect just reordering to:
	extra_pages = min3(extra_pages, max_pages - max_pfn,
		EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)));
will have a similar effect.

I'll try to do a v2 of the patchset tomorrow.
- I'll leave __is_constexpr() with its current define (for now).
- Fix the issue the build robot fount.
- Fix the typo in min3().
- use auto_type for min/max functions.

Once that lot is in I'll do some further changes for 'next'.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ