From: Eric Dumazet <eric.dumazet@gmail.com>
To: Benjamin LaHaise <bcrl@kvack.org>
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 15:57:31 +0200 [thread overview]
Message-ID: <1348667851.5093.355.camel@edumazet-glaptop> (raw)
In-Reply-To: <20120926131110.GL10611@kvack.org>
On Wed, 2012-09-26 at 09:11 -0400, Benjamin LaHaise wrote:
> 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,
>
Indeed, thanks Ben !
next prev parent reply other threads:[~2012-09-26 13:57 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
2012-09-26 13:57 ` Eric Dumazet [this message]
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=1348667851.5093.355.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=bcrl@kvack.org \
--cc=davem@davemloft.net \
--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