diff mbox

[net-next,v4,1/6] net: allow > 0 order atomic page alloc in skb_page_frag_refill

Message ID 1389901950-3854-1-git-send-email-mwdalton@google.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Michael Dalton Jan. 16, 2014, 7:52 p.m. UTC
skb_page_frag_refill currently permits only order-0 page allocs
unless GFP_WAIT is used. Change skb_page_frag_refill to attempt
higher-order page allocations whether or not GFP_WAIT is used. If
memory cannot be allocated, the allocator will fall back to
successively smaller page allocs (down to order-0 page allocs).

This change brings skb_page_frag_refill in line with the existing
page allocation strategy employed by netdev_alloc_frag, which attempts
higher-order page allocations whether or not GFP_WAIT is set, falling
back to successively lower-order page allocations on failure. Part
of migration of virtio-net to per-receive queue page frag allocators.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Michael Dalton <mwdalton@google.com>
---
 net/core/sock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

David Miller Jan. 16, 2014, 11:28 p.m. UTC | #1
All 6 patches applied.

Next time, PLEASE, give me a header email ala "[PATCH net-next v4 0/6]" giving
a broad overview of the series.

This serves several purposes.

First, it gives me a single top-level email to reply to when I want to let
you know that I've either applied or rejected this series.  Because you
didn't provide a header posting, I have to pick an arbitrary one of
the patches to use for this purpose as I have done here.

Second, it gives a place for you to describe at a high level what the patch
series is doing.  I create dummy merge commits and place that descriptive
text into it, so that anyone else looking at the GIT history can see that
these patches go together as a coherent unit and what that unit is trying
to achieve.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michael Dalton Jan. 17, 2014, 12:30 a.m. UTC | #2
On Thu, Jan 16, 2014 at 3:30 PM, David Miller <davem@davemloft.net> wrote:
> Actually, I reverted, please resubmit this series with the following
> build warning corrected:

Thanks David, I will send out another patchset shortly with the warning
resolved and a header e-mail (and one other sysfs group fix that I just
found in the same file). Sorry I didn't include a header e-mail
initially.

Best,

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

Patch

diff --git a/net/core/sock.c b/net/core/sock.c
index 85ad6f0..b3f7ee3 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1836,9 +1836,7 @@  bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio)
 		put_page(pfrag->page);
 	}
 
-	/* We restrict high order allocations to users that can afford to wait */
-	order = (prio & __GFP_WAIT) ? SKB_FRAG_PAGE_ORDER : 0;
-
+	order = SKB_FRAG_PAGE_ORDER;
 	do {
 		gfp_t gfp = prio;