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: <1429734048.18561.142.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Wed, 22 Apr 2015 13:20:48 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, edumazet@...gle.com, gthelen@...gle.com,
	rientjes@...gle.com, mgorman@...e.de
Subject: Re: [PATCH net] net: do not deplete pfmemalloc reserve

On Wed, 2015-04-22 at 15:35 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Wed, 22 Apr 2015 07:33:36 -0700
> 
> > Also, we must refrain using high order pages from the pfmemalloc
> > reserve, so __page_frag_refill() must also use __GFP_NOMEMALLOC for
> > them. Under memory pressure, using order-0 pages is probably the best
> > strategy.
>  ...
> > @@ -348,7 +352,8 @@ static struct page *__page_frag_refill(struct netdev_alloc_cache *nc,
> >  	gfp_t gfp = gfp_mask;
> >  
> >  	if (order) {
> > -		gfp_mask |= __GFP_COMP | __GFP_NOWARN | __GFP_NORETRY;
> > +		gfp_mask |= __GFP_COMP | __GFP_NOWARN | __GFP_NORETRY |
> > +			    __GFP_NOMEMALLOC;
> >  		page = alloc_pages_node(NUMA_NO_NODE, gfp_mask, order);
> 
> Hmmm, skbuff.h says:
> 
>  * @gfp_mask: allocation priority. Set __GFP_NOMEMALLOC if not for network Rx
> 
> But that's exactly what this __page_frag_refill() code is primarily
> being used for, network RX, right?
> 
> If we believe the comment, you should not be adding the
> __GFP_NOMEMALLOC flag here.

I do not see a problem here.

We attempt high order pages allocations only if they bring a performance
gain. Under memory pressure, there is the high risk a whole order-3 page
is consumed by a tiny buffer using 200 bytes but not consumed.

Only high order pages allocation attempts should request this
__GFP_NOMEMALLOC flag set.

order-0 pages will have __GFP_MEMALLOC if requested by at least one
socket in the host.

About __dev_alloc_pages() comment / users, they have to know if they
need high order pages, or could fallback to order-0 ones.

We can update the comments in skbuff.h, but so far the only user has no
need to assert __GFP_NOMEMALLOC.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ