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: <20240604094245.zn5hqezd5q5eoehv@quentin>
Date: Tue, 4 Jun 2024 09:42:45 +0000
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: david@...morbit.com, chandan.babu@...cle.com, akpm@...ux-foundation.org,
	brauner@...nel.org, djwong@...nel.org, linux-kernel@...r.kernel.org,
	hare@...e.de, john.g.garry@...cle.com, gost.dev@...sung.com,
	yang@...amperecomputing.com, p.raghav@...sung.com,
	cl@...amperecomputing.com, linux-xfs@...r.kernel.org, hch@....de,
	mcgrof@...nel.org, linux-mm@...ck.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v6 03/11] filemap: allocate mapping_min_order folios in
 the page cache

On Mon, Jun 03, 2024 at 01:18:45PM +0100, Matthew Wilcox wrote:
> On Wed, May 29, 2024 at 03:45:01PM +0200, Pankaj Raghav (Samsung) wrote:
> > @@ -1919,8 +1921,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
> >  		folio_wait_stable(folio);
> >  no_page:
> >  	if (!folio && (fgp_flags & FGP_CREAT)) {
> > -		unsigned order = FGF_GET_ORDER(fgp_flags);
> > +		unsigned int min_order = mapping_min_folio_order(mapping);
> > +		unsigned int order = max(min_order, FGF_GET_ORDER(fgp_flags));
> >  		int err;
> > +		index = mapping_align_start_index(mapping, index);
> >  
> >  		if ((fgp_flags & FGP_WRITE) && mapping_can_writeback(mapping))
> >  			gfp |= __GFP_WRITE;
> > @@ -1958,7 +1962,7 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
> >  				break;
> >  			folio_put(folio);
> >  			folio = NULL;
> > -		} while (order-- > 0);
> > +		} while (order-- > min_order);
> 
> I'd argue you also need to change:
> 
> -                       if (order > 0)
> +			if (order > min_order)
>                                 alloc_gfp |= __GFP_NORETRY | __GFP_NOWARN;
> 
> since that is the last point at which we can fall back.  If we can't
> immediately allocate a min_order folio, we want to retry, and we
> want to warn if we can't get it.

That is a good point. It is also a feedback to the admin if they start
using LBS and assess the memory requirement based on memory alloc
warning?

--
Pankaj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ