Subject: Re: [PATCH net-next] net: use bigger pages in __netdev_alloc_frag

From: Benjamin LaHaise <[email-masked]>
Date: Wed, 26 Sep 2012 09:11:10 -0400

Hello Eric,

On Wed, Sep 26, 2012 at 11:06:42AM +0200, Eric Dumazet wrote:
> +	int order;
...
> +		for (order = NETDEV_FRAG_PAGE_MAX_ORDER; ;) {
> +			gfp_t gfp = gfp_mask;
> +
> +			if (order)
> +				gfp |= __GFP_COMP | __GFP_NOWARN;
> +			nc->frag.page = alloc_pages(gfp, order);
> +			if (likely(nc->frag.page))
> +				break;
> +			if (--order <= 0)
> +				goto end;
> +		}

I think you probably intended the last if to be "if (--order < 0)", as 
otherwise the alloc will never be attempted with an order 0 page, which 
could harm systems suffering from extreme memory fragmentation.  Cheers,

		-ben