Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Michael S. Tsirkin
On Wed, May 10, 2017 at 11:30:42AM +0800, Jason Wang wrote: > > > On 2017年05月09日 21:33, Michael S. Tsirkin wrote: > > > I love this idea. Reviewed and discussed the idea in-person with MST > > > during netdevconf[1] at this laptop. I promised I will also run it > > > through my

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Michael S. Tsirkin
On Wed, May 10, 2017 at 11:30:42AM +0800, Jason Wang wrote: > > > On 2017年05月09日 21:33, Michael S. Tsirkin wrote: > > > I love this idea. Reviewed and discussed the idea in-person with MST > > > during netdevconf[1] at this laptop. I promised I will also run it > > > through my

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Michael S. Tsirkin
On Wed, May 10, 2017 at 11:18:13AM +0200, Jesper Dangaard Brouer wrote: > On Tue, 9 May 2017 16:33:14 +0300 > "Michael S. Tsirkin" wrote: > > > On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > > > On Fri, 7 Apr 2017 08:49:57 +0300 > > > "Michael S.

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Michael S. Tsirkin
On Wed, May 10, 2017 at 11:18:13AM +0200, Jesper Dangaard Brouer wrote: > On Tue, 9 May 2017 16:33:14 +0300 > "Michael S. Tsirkin" wrote: > > > On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > > > On Fri, 7 Apr 2017 08:49:57 +0300 > > > "Michael S. Tsirkin" wrote: > > >

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Jesper Dangaard Brouer
On Tue, 9 May 2017 16:33:14 +0300 "Michael S. Tsirkin" wrote: > On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > > On Fri, 7 Apr 2017 08:49:57 +0300 > > "Michael S. Tsirkin" wrote: > > > > > A known weakness in ptr_ring design is

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-10 Thread Jesper Dangaard Brouer
On Tue, 9 May 2017 16:33:14 +0300 "Michael S. Tsirkin" wrote: > On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > > On Fri, 7 Apr 2017 08:49:57 +0300 > > "Michael S. Tsirkin" wrote: > > > > > A known weakness in ptr_ring design is that it does not handle well the > >

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-09 Thread Jason Wang
On 2017年05月09日 21:33, Michael S. Tsirkin wrote: I love this idea. Reviewed and discussed the idea in-person with MST during netdevconf[1] at this laptop. I promised I will also run it through my micro-benchmarking[2] once I return home (hint ptr_ring gets used in network stack as skb_array).

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-09 Thread Jason Wang
On 2017年05月09日 21:33, Michael S. Tsirkin wrote: I love this idea. Reviewed and discussed the idea in-person with MST during netdevconf[1] at this laptop. I promised I will also run it through my micro-benchmarking[2] once I return home (hint ptr_ring gets used in network stack as skb_array).

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-09 Thread Michael S. Tsirkin
On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 7 Apr 2017 08:49:57 +0300 > "Michael S. Tsirkin" wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > situation when ring is almost full: as entries are consumed

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-05-09 Thread Michael S. Tsirkin
On Sat, Apr 08, 2017 at 02:14:08PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 7 Apr 2017 08:49:57 +0300 > "Michael S. Tsirkin" wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > situation when ring is almost full: as entries are consumed they are > >

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-17 Thread Jason Wang
On 2017年04月15日 06:50, Michael S. Tsirkin wrote: On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-17 Thread Jason Wang
On 2017年04月15日 06:50, Michael S. Tsirkin wrote: On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-17 Thread Jason Wang
On 2017年04月15日 05:00, Michael S. Tsirkin wrote: On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-17 Thread Jason Wang
On 2017年04月15日 05:00, Michael S. Tsirkin wrote: On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Michael S. Tsirkin
On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: > > > On 2017年04月12日 16:03, Jason Wang wrote: > > > > > > On 2017年04月07日 13:49, Michael S. Tsirkin wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > > situation when ring is almost full: as

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Michael S. Tsirkin
On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: > > > On 2017年04月12日 16:03, Jason Wang wrote: > > > > > > On 2017年04月07日 13:49, Michael S. Tsirkin wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > > situation when ring is almost full: as

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Michael S. Tsirkin
On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: > > > On 2017年04月12日 16:03, Jason Wang wrote: > > > > > > On 2017年04月07日 13:49, Michael S. Tsirkin wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > > situation when ring is almost full: as

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Michael S. Tsirkin
On Fri, Apr 14, 2017 at 03:52:23PM +0800, Jason Wang wrote: > > > On 2017年04月12日 16:03, Jason Wang wrote: > > > > > > On 2017年04月07日 13:49, Michael S. Tsirkin wrote: > > > A known weakness in ptr_ring design is that it does not handle well the > > > situation when ring is almost full: as

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Jason Wang
On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-14 Thread Jason Wang
On 2017年04月12日 16:03, Jason Wang wrote: On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-12 Thread Jason Wang
On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and producer are writing to a shared cache line. To

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-12 Thread Jason Wang
On 2017年04月07日 13:49, Michael S. Tsirkin wrote: A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and producer are writing to a shared cache line. To

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-08 Thread Jesper Dangaard Brouer
On Fri, 7 Apr 2017 08:49:57 +0300 "Michael S. Tsirkin" wrote: > A known weakness in ptr_ring design is that it does not handle well the > situation when ring is almost full: as entries are consumed they are > immediately used again by the producer, so consumer and producer are >

Re: [PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-08 Thread Jesper Dangaard Brouer
On Fri, 7 Apr 2017 08:49:57 +0300 "Michael S. Tsirkin" wrote: > A known weakness in ptr_ring design is that it does not handle well the > situation when ring is almost full: as entries are consumed they are > immediately used again by the producer, so consumer and producer are > writing to a

[PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-06 Thread Michael S. Tsirkin
A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and producer are writing to a shared cache line. To fix this, add batching to consume calls: as entries

[PATCH 1/3] ptr_ring: batch ring zeroing

2017-04-06 Thread Michael S. Tsirkin
A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and producer are writing to a shared cache line. To fix this, add batching to consume calls: as entries