search for: ewma_add

Displaying 20 results from an estimated 43 matches for "ewma_add".

2013 Nov 13
2
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...+ est_buffer_len = page_private(page); > + if (est_buffer_len > len) { > + u32 truesize_delta = est_buffer_len - len; > + > + curr_skb->truesize += truesize_delta; > + if (curr_skb != head_skb) > + head_skb->truesize += truesize_delta; > + } > + } > + ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); Hi, I looked at how ewma works, and although it is computationally efficient, and it does what it is supposed to do, initially (at the first samples) it is strongly biased towards the value that was added at the first ewma_add. I suggest that you pr...
2013 Nov 13
2
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...+ est_buffer_len = page_private(page); > + if (est_buffer_len > len) { > + u32 truesize_delta = est_buffer_len - len; > + > + curr_skb->truesize += truesize_delta; > + if (curr_skb != head_skb) > + head_skb->truesize += truesize_delta; > + } > + } > + ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); Hi, I looked at how ewma works, and although it is computationally efficient, and it does what it is supposed to do, initially (at the first samples) it is strongly biased towards the value that was added at the first ewma_add. I suggest that you pr...
2014 Jan 16
2
[PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
Sorry, just realized - I think disabling NAPI is necessary but not sufficient. There is also the issue that refill_work() could be scheduled. If refill_work() executes, it will re-enable NAPI. We'd need to cancel the vi->refill delayed work to prevent this AFAICT, and also ensure that no other function re-schedules vi->refill or re-enables NAPI (virtnet_open/close, virtnet_set_queues,
2014 Jan 16
2
[PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
Sorry, just realized - I think disabling NAPI is necessary but not sufficient. There is also the issue that refill_work() could be scheduled. If refill_work() executes, it will re-enable NAPI. We'd need to cancel the vi->refill delayed work to prevent this AFAICT, and also ensure that no other function re-schedules vi->refill or re-enables NAPI (virtnet_open/close, virtnet_set_queues,
2013 Nov 13
0
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
On Wed, 2013-11-13 at 10:47 +0200, Ronen Hod wrote: > I looked at how ewma works, and although it is computationally efficient, > and it does what it is supposed to do, initially (at the first samples) it is strongly > biased towards the value that was added at the first ewma_add. > I suggest that you print the values of ewma_add() and ewma_read(). If you are > happy with the results, then ignore my comments. If you are not, then I can > provide a version that does better for the first samples. > Unfortunately, it will be slightly less efficient. Value is clamp...
2014 Jan 16
0
[PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
...s reading a value that might be updated ? This is purely a debugging utility. As soon as you read the value, it might already have changed anyway. Its a integer, just read it without special care. atomic_read() has also same 'problem', and we do not care. Make sure that a recompute (aka ewma_add()) does not store intermediate wrong values, by using ACCESS_ONCE(), and thats enough. No need for the seqcount overhead. diff --git a/lib/average.c b/lib/average.c index 99a67e662b3c..044e0b7f28a8 100644 --- a/lib/average.c +++ b/lib/average.c @@ -53,8 +53,10 @@ EXPORT_SYMBOL(ewma_init); */ st...
2014 Jan 16
0
[PATCH net-next v4 5/6] lib: Ensure EWMA does not store wrong intermediate values
To ensure ewma_read() without a lock returns a valid but possibly out of date average, modify ewma_add() by using ACCESS_ONCE to prevent intermediate wrong values from being written to avg->internal. Suggested-by: Eric Dumazet <eric.dumazet at gmail.com> Signed-off-by: Michael Dalton <mwdalton at google.com> --- lib/average.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(...
2013 Nov 13
1
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...; On Wed, 2013-11-13 at 10:47 +0200, Ronen Hod wrote: > >> I looked at how ewma works, and although it is computationally efficient, >> and it does what it is supposed to do, initially (at the first samples) it is strongly >> biased towards the value that was added at the first ewma_add. >> I suggest that you print the values of ewma_add() and ewma_read(). If you are >> happy with the results, then ignore my comments. If you are not, then I can >> provide a version that does better for the first samples. >> Unfortunately, it will be slightly less efficient....
2013 Nov 13
1
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...; On Wed, 2013-11-13 at 10:47 +0200, Ronen Hod wrote: > >> I looked at how ewma works, and although it is computationally efficient, >> and it does what it is supposed to do, initially (at the first samples) it is strongly >> biased towards the value that was added at the first ewma_add. >> I suggest that you print the values of ewma_add() and ewma_read(). If you are >> happy with the results, then ignore my comments. If you are not, then I can >> provide a version that does better for the first samples. >> Unfortunately, it will be slightly less efficient....
2014 Jan 16
13
[PATCH net-next v4 1/6] 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
2014 Jan 16
13
[PATCH net-next v4 1/6] 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
2014 Jan 07
0
[PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
...ue_stats *rq_stats = vi->rq_stats[vq2rxq(rq->vq)]; int num_buf = hdr->mhdr.num_buffers; struct page *page = virt_to_head_page(ctx->buf); int offset = ctx->buf - page_address(page); @@ -413,7 +449,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } } - ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); + write_seqcount_begin(&rq_stats->dbg_seq); + ewma_add(&rq_stats->avg_pkt_len, head_skb->len); + write_seqcount_end(&rq_stats->dbg_seq); return head_skb; err_skb: @@ -600,18 +638,30 @@ static int add_recvbuf_big(struct rec...
2013 Nov 13
0
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...+= truesize_delta; > > + if (curr_skb != head_skb) > > + head_skb->truesize += truesize_delta; > > + } > > Is there a chance that est_buffer_len was smaller than or equal with len? Yes, and in this case we do not really care, see below. > > + } > > + ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); > > return 0; > > } > > > > @@ -382,16 +404,21 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) > > skb_trim(skb, len); > > } else if (vi->mergeable_rx_bufs) { > >...
2015 Aug 19
0
[PATCH 1/4] virtio_net: use DECLARE_EWMA
...ge packet length for mergeable receive buffers. */ - struct ewma mrg_avg_pkt_len; + struct ewma_pkt_len mrg_avg_pkt_len; /* Page frag for packet buffer allocation. */ struct page_frag alloc_frag; @@ -407,7 +407,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } } - ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); + ewma_pkt_len_add(&rq->mrg_avg_pkt_len, head_skb->len); return head_skb; err_skb: @@ -600,12 +600,12 @@ static int add_recvbuf_big(struct virtnet_info *vi, struct receive_queue *rq, return err; } -static unsigned int get_mergeable...
2015 Aug 19
0
[PATCH 1/4] virtio_net: use DECLARE_EWMA
...ge packet length for mergeable receive buffers. */ - struct ewma mrg_avg_pkt_len; + struct ewma_pkt_len mrg_avg_pkt_len; /* Page frag for packet buffer allocation. */ struct page_frag alloc_frag; @@ -407,7 +407,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } } - ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); + ewma_pkt_len_add(&rq->mrg_avg_pkt_len, head_skb->len); return head_skb; err_skb: @@ -600,12 +600,12 @@ static int add_recvbuf_big(struct virtnet_info *vi, struct receive_queue *rq, return err; } -static unsigned int get_mergeable...
2014 Jan 16
0
[PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
...is enforced by virtio-net + * and NAPI. + */ + seqcount_t sysfs_seq; + /* Page frag for packet buffer allocation. */ struct page_frag alloc_frag; @@ -416,7 +423,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } } + write_seqcount_begin(&rq->sysfs_seq); ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); + write_seqcount_end(&rq->sysfs_seq); return head_skb; err_skb: @@ -604,18 +613,29 @@ static int add_recvbuf_big(struct receive_queue *rq, gfp_t gfp) return err; } -static int add_recvbuf_mergeable(struct receive_queue *rq, gfp_t gfp)...
2014 Jan 07
10
[PATCH net-next v2 1/4] 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
2014 Jan 07
10
[PATCH net-next v2 1/4] 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 13
4
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...) { > + u32 truesize_delta = est_buffer_len - len; > + > + curr_skb->truesize += truesize_delta; > + if (curr_skb != head_skb) > + head_skb->truesize += truesize_delta; > + } Is there a chance that est_buffer_len was smaller than or equal with len? > + } > + ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); > return 0; > } > > @@ -382,16 +404,21 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) > skb_trim(skb, len); > } else if (vi->mergeable_rx_bufs) { > struct page *page = virt_to_hea...
2013 Nov 13
4
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...) { > + u32 truesize_delta = est_buffer_len - len; > + > + curr_skb->truesize += truesize_delta; > + if (curr_skb != head_skb) > + head_skb->truesize += truesize_delta; > + } Is there a chance that est_buffer_len was smaller than or equal with len? > + } > + ewma_add(&rq->mrg_avg_pkt_len, head_skb->len); > return 0; > } > > @@ -382,16 +404,21 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) > skb_trim(skb, len); > } else if (vi->mergeable_rx_bufs) { > struct page *page = virt_to_hea...