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]
Date:	Sat, 23 Aug 2014 16:51:53 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Govindarajulu Varadarajan <_govind@....com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
	mgorman@...e.de
Subject: Re: [PATCH RFC net-next 1/2] net: skbuff: propagate pfmemalloc to
 skb

On Sun, 2014-08-24 at 03:07 +0530, Govindarajulu Varadarajan wrote:
> In __netdev_alloc_skb, __netdev_alloc_frag might have allocated page with
> flag __GFP_MEMALLOC. But we do not propagate it to the skb.
> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@....com>
> ---
>  net/core/skbuff.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 163b673..51a3328 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -425,8 +425,14 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
>  
>  		if (likely(data)) {
>  			skb = build_skb(data, fragsz);
> -			if (unlikely(!skb))
> +			if (unlikely(!skb)) {
>  				put_page(virt_to_head_page(data));
> +			} else {
> +				struct page *page;
> +
> +				page = virt_to_head_page(data);
> +				skb_propagate_pfmemalloc(page, skb);
> +			}
>  		}
>  	} else {
>  		skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask,

Oh well...

We made everything we could to avoid touching the page head for every
frag allocation.

Just cache page->pfmemalloc into nc->frag.pfmemalloc

Think of how often asymmetric alloc/free happen in networking stack and
why we use NETDEV_PAGECNT_MAX_BIAS trick.

Thanks


--
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