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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aG0QVClTHrP0oPLm@pc636>
Date: Tue, 8 Jul 2025 14:34:28 +0200
From: Uladzislau Rezki <urezki@...il.com>
To: Michal Hocko <mhocko@...e.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@...il.com>, linux-mm@...ck.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, Baoquan He <bhe@...hat.com>
Subject: Re: [RFC 2/7] mm/vmalloc: Support non-blocking GFP flags in
 alloc_vmap_area()

On Mon, Jul 07, 2025 at 09:11:35AM +0200, Michal Hocko wrote:
> On Fri 04-07-25 17:25:32, Uladzislau Rezki wrote:
> [...]
> > @@ -2030,7 +2033,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
> >  	 */
> >  	va = node_alloc(size, align, vstart, vend, &addr, &vn_id);
> >  	if (!va) {
> > -		gfp_mask = gfp_mask & GFP_RECLAIM_MASK;
> > +		if (allow_block)
> > +			gfp_mask = gfp_mask & GFP_RECLAIM_MASK;
> 
> I don't follow here and is this even correct?
> 
Allow nested flags to follow a user request if there is a request
to not block. For example if we apply GFP_RECLAIM_MASK to GFP_ATOMIC
GFP_ATOMIC is converted to zero, thus to GFP_NOWAIT.

> >  
> >  		va = kmem_cache_alloc_node(vmap_area_cachep, gfp_mask, node);
> >  		if (unlikely(!va))
> > @@ -2057,8 +2061,14 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
> >  	 * If an allocation fails, the error value is
> >  	 * returned. Therefore trigger the overflow path.
> >  	 */
> > -	if (IS_ERR_VALUE(addr))
> > +	if (IS_ERR_VALUE(addr)) {
> > +		if (!allow_block) {
> > +			kmem_cache_free(vmap_area_cachep, va);
> > +			return ERR_PTR(-ENOMEM);
> 
> I would suggest to add a comment for this. Something like
> 
> for blockable requests trigger the overflow paths because that
> relies on vmap_purge_lock mutex and blocking notifiers.
> 
Thanks, i can do it easily. Also, this is an RFC i think it should
be split and improved. Maybe to move out some functionality into a
separate function.

--
Uladzislau Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ