Skip to content

Commit 097b4f1

Browse files
Michael Daltondavem330
authored andcommitted
net: allow > 0 order atomic page alloc in skb_page_frag_refill
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 <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: Michael Dalton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 722e47d commit 097b4f1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/core/sock.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,9 +1836,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio)
18361836
put_page(pfrag->page);
18371837
}
18381838

1839-
/* We restrict high order allocations to users that can afford to wait */
1840-
order = (prio & __GFP_WAIT) ? SKB_FRAG_PAGE_ORDER : 0;
1841-
1839+
order = SKB_FRAG_PAGE_ORDER;
18421840
do {
18431841
gfp_t gfp = prio;
18441842

0 commit comments

Comments
 (0)