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] [day] [month] [year] [list]
Message-ID: <pesfhdmkz2essyfcesxqekwkxbrkw343qifwkuzrvirw6yyn4i@xjkigwtyczrh>
Date: Thu, 17 Jul 2025 14:07:31 +0200
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: David Hildenbrand <david@...hat.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>, 
	Ryan Roberts <ryan.roberts@....com>, Baolin Wang <baolin.wang@...ux.alibaba.com>, 
	Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...hat.com>, 
	"H . Peter Anvin" <hpa@...or.com>, Vlastimil Babka <vbabka@...e.cz>, Zi Yan <ziy@...dia.com>, 
	Mike Rapoport <rppt@...nel.org>, Dave Hansen <dave.hansen@...ux.intel.com>, 
	Michal Hocko <mhocko@...e.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, 
	Andrew Morton <akpm@...ux-foundation.org>, Thomas Gleixner <tglx@...utronix.de>, 
	Nico Pache <npache@...hat.com>, Dev Jain <dev.jain@....com>, 
	"Liam R . Howlett" <Liam.Howlett@...cle.com>, Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org, 
	willy@...radead.org, linux-mm@...ck.org, x86@...nel.org, linux-block@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org, "Darrick J . Wong" <djwong@...nel.org>, mcgrof@...nel.org, 
	gost.dev@...sung.com, hch@....de, Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [PATCH v2 3/5] mm: add static PMD zero page

On Thu, Jul 17, 2025 at 01:46:03PM +0200, David Hildenbrand wrote:
> On 17.07.25 12:34, Pankaj Raghav (Samsung) wrote:
> > > > Then, we'd only need a config option to allow for that to happen.
> > > 
> > > Something incomplete and very hacky just to give an idea. It would try allocating
> > > it if there is actual code running that would need it, and then have it
> > > stick around forever.
> > > 
> > Thanks a lot for this David :) I think this is a much better idea and
> > reduces the amount code and reuse the existing infrastructure.
> > 
> > I will try this approach in the next version.
> > 
> > <snip>
> > > +       /*
> > > +        * Our raised reference will prevent the shrinker from ever having
> > > +        * success -> static.
> > > +        */
> > > +       if (atomic_read(&huge_zero_folio_is_static))
> > > +               return huge_zero_folio;
> > > +       /* TODO: memblock allocation if buddy is not up yet? Or Reject that earlier. */
> > 
> > Do we need memblock allocation? At least the use cases I forsee for
> > static pmd zero page are all after the mm is up. So I don't see why we
> > need to allocate it via memblock.
> 
> Even better!
> 
> We might want to detect whether allocation of the huge zeropage failed a
> couple of times and then just give up. Otherwise, each and every user of the
> largest zero folio will keep allocating it.

Yes, that makes sense. We need sort of like a global counter to count
the nr of failures and then give up trying to allocate it if it goes
above a threshold.

--
Pankaj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ