Displaying 20 results from an estimated 21 matches for "sleep_frag".
2013 Dec 23
2
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...;
>
> @@ -127,9 +130,9 @@ struct virtnet_info {
> struct mutex config_lock;
>
> /* Page_frag for GFP_KERNEL packet buffer allocation when we run
> - * low on memory.
> + * low on memory. May sleep.
> */
> - struct page_frag alloc_frag;
> + struct page_frag sleep_frag;
Any reason to use two different page_frag consider only
skb_page_frag_refill() is used?
>
> /* Does the affinity hint is set for virtqueues? */
> bool affinity_hint_set;
> @@ -336,8 +339,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
> int num_buf = h...
2013 Dec 23
2
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...;
>
> @@ -127,9 +130,9 @@ struct virtnet_info {
> struct mutex config_lock;
>
> /* Page_frag for GFP_KERNEL packet buffer allocation when we run
> - * low on memory.
> + * low on memory. May sleep.
> */
> - struct page_frag alloc_frag;
> + struct page_frag sleep_frag;
Any reason to use two different page_frag consider only
skb_page_frag_refill() is used?
>
> /* Does the affinity hint is set for virtqueues? */
> bool affinity_hint_set;
> @@ -336,8 +339,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
> int num_buf = h...
2013 Dec 17
0
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...ader */
struct scatterlist sg[MAX_SKB_FRAGS + 2];
@@ -127,9 +130,9 @@ struct virtnet_info {
struct mutex config_lock;
/* Page_frag for GFP_KERNEL packet buffer allocation when we run
- * low on memory.
+ * low on memory. May sleep.
*/
- struct page_frag alloc_frag;
+ struct page_frag sleep_frag;
/* Does the affinity hint is set for virtqueues? */
bool affinity_hint_set;
@@ -336,8 +339,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
int num_buf = hdr->mhdr.num_buffers;
struct page *page = virt_to_head_page(buf);
int offset = buf - page_address(page);
-...
2013 Nov 12
0
[PATCH net-next 3/4] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...ader */
struct scatterlist sg[MAX_SKB_FRAGS + 2];
@@ -128,9 +131,9 @@ struct virtnet_info {
struct mutex config_lock;
/* Page_frag for GFP_KERNEL packet buffer allocation when we run
- * low on memory.
+ * low on memory. May sleep.
*/
- struct page_frag alloc_frag;
+ struct page_frag sleep_frag;
/* Does the affinity hint is set for virtqueues? */
bool affinity_hint_set;
@@ -305,7 +308,7 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb)
struct sk_buff *curr_skb = head_skb;
char *buf;
struct page *page;
- int num_buf, len, offset;
+ int num_buf,...
2013 Dec 17
15
[PATCH net-next 1/3] 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
2013 Dec 17
15
[PATCH net-next 1/3] 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
2013 Nov 12
12
[PATCH net-next 1/4] virtio-net: mergeable buffer size should include virtio-net header
Commit 2613af0ed18a ("virtio_net: migrate mergeable rx buffers to page
frag allocators") changed the mergeable receive buffer size from PAGE_SIZE
to MTU-size. However, the merge buffer size does not take into account the
size of the virtio-net header. Consequently, packets that are MTU-size
will take two buffers intead of one (to store the virtio-net header),
substantially decreasing the
2013 Nov 12
12
[PATCH net-next 1/4] virtio-net: mergeable buffer size should include virtio-net header
Commit 2613af0ed18a ("virtio_net: migrate mergeable rx buffers to page
frag allocators") changed the mergeable receive buffer size from PAGE_SIZE
to MTU-size. However, the merge buffer size does not take into account the
size of the virtio-net header. Consequently, packets that are MTU-size
will take two buffers intead of one (to store the virtio-net header),
substantially decreasing the
2013 Dec 23
0
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...virtnet_info {
> > struct mutex config_lock;
> >
> > /* Page_frag for GFP_KERNEL packet buffer allocation when we run
> > - * low on memory.
> > + * low on memory. May sleep.
> > */
> > - struct page_frag alloc_frag;
> > + struct page_frag sleep_frag;
>
> Any reason to use two different page_frag consider only
> skb_page_frag_refill() is used?
One is used under process context, where preemption and GFP_KERNEL are
allowed.
One is used from softirq context and GFP_ATOMIC. You cant share a common
page_frag.
Acked-by: Eric Dumazet <...
2013 Nov 13
0
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...r, hole;
> > + u32 buflen;
> >
> > + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> > + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> > + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> > alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> > - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> > + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> > return -ENOMEM;
> > buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;...
2013 Nov 13
4
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...err, len, hole;
> + int err, hole;
> + u32 buflen;
>
> + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> return -ENOMEM;
> buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
> get_page(allo...
2013 Nov 13
4
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...err, len, hole;
> + int err, hole;
> + u32 buflen;
>
> + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> return -ENOMEM;
> buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
> get_page(allo...
2013 Dec 23
3
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...mutex config_lock;
> > >
> > > /* Page_frag for GFP_KERNEL packet buffer allocation when we run
> > > - * low on memory.
> > > + * low on memory. May sleep.
> > > */
> > > - struct page_frag alloc_frag;
> > > + struct page_frag sleep_frag;
> >
> > Any reason to use two different page_frag consider only
> > skb_page_frag_refill() is used?
>
> One is used under process context, where preemption and GFP_KERNEL are
> allowed.
Yes but it is always used with napi disabled.
> One is used from softirq conte...
2013 Dec 23
3
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...mutex config_lock;
> > >
> > > /* Page_frag for GFP_KERNEL packet buffer allocation when we run
> > > - * low on memory.
> > > + * low on memory. May sleep.
> > > */
> > > - struct page_frag alloc_frag;
> > > + struct page_frag sleep_frag;
> >
> > Any reason to use two different page_frag consider only
> > skb_page_frag_refill() is used?
>
> One is used under process context, where preemption and GFP_KERNEL are
> allowed.
Yes but it is always used with napi disabled.
> One is used from softirq conte...
2013 Dec 17
0
[PATCH net-next 3/3] net: auto-tune mergeable rx buffer size for improved performance
...rag *alloc_frag;
char *buf;
- int err, len, hole;
+ int err, hole;
+ u32 buflen;
+ buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
+ GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
+ buflen = ALIGN(buflen, L1_CACHE_BYTES);
alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
- if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
+ if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
return -ENOMEM;
buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
get_page(alloc_frag->page);
- len =...
2013 Nov 12
0
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...rag *alloc_frag;
char *buf;
- int err, len, hole;
+ int err, hole;
+ u32 buflen;
+ buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
+ GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
+ buflen = ALIGN(buflen, L1_CACHE_BYTES);
alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
- if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
+ if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
return -ENOMEM;
buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
get_page(alloc_frag->page);
- len =...
2013 Nov 13
0
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...r, hole;
> > + u32 buflen;
> >
> > + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> > + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> > + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> > alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> > - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> > + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> > return -ENOMEM;
> > buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;...
2013 Nov 13
2
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...rr, len, hole;
> + int err, hole;
> + u32 buflen;
>
> + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> return -ENOMEM;
> buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
> get_page(a...
2013 Nov 13
2
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...rr, len, hole;
> + int err, hole;
> + u32 buflen;
>
> + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> return -ENOMEM;
> buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
> get_page(a...
2013 Dec 23
2
[PATCH net-next 3/3] net: auto-tune mergeable rx buffer size for improved performance
...err, len, hole;
> + int err, hole;
> + u32 buflen;
>
> + buflen = hdr_len + clamp_t(u32, ewma_read(&rq->mrg_avg_pkt_len),
> + GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
> + buflen = ALIGN(buflen, L1_CACHE_BYTES);
> alloc_frag = (gfp & __GFP_WAIT) ? &vi->sleep_frag : &rq->atomic_frag;
> - if (unlikely(!skb_page_frag_refill(MERGE_BUFFER_LEN, alloc_frag, gfp)))
> + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, gfp)))
> return -ENOMEM;
> buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
> get_page(allo...