From: Benjamin LaHaise <bcrl@kvack.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Alexander Duyck <alexander.h.duyck@intel.com>
Subject: Re: [PATCH net-next] net: use bigger pages in __netdev_alloc_frag
Date: Wed, 26 Sep 2012 09:11:10 -0400 [thread overview]
Message-ID: <20120926131110.GL10611@kvack.org> (raw)
In-Reply-To: <1348650402.5093.176.camel@edumazet-glaptop>
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
next prev parent reply other threads:[~2012-09-26 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 9:06 [PATCH net-next] net: use bigger pages in __netdev_alloc_frag Eric Dumazet
2012-09-26 13:11 ` Benjamin LaHaise [this message]
2012-09-26 13:57 ` Eric Dumazet
2012-09-26 16:00 ` Alexander Duyck
2012-09-26 16:14 ` Eric Dumazet
2012-09-26 16:36 ` Alexander Duyck
2012-09-26 16:46 ` [PATCH net-next v2] " Eric Dumazet
2012-09-27 23:30 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120926131110.GL10611@kvack.org \
--to=bcrl@kvack.org \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).