Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Jason Wang
On 2018年02月28日 23:43, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 10:20:33PM +0800, Jason Wang wrote: On 2018年02月28日 22:01, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Jason Wang
On 2018年02月28日 23:43, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 10:20:33PM +0800, Jason Wang wrote: On 2018年02月28日 22:01, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 10:20:33PM +0800, Jason Wang wrote: > > > On 2018年02月28日 22:01, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: > > > > > > On 2018年02月28日 12:09, Michael S. Tsirkin wrote: > > > > > > Or we can add plist to a union: > > > > > >

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 10:20:33PM +0800, Jason Wang wrote: > > > On 2018年02月28日 22:01, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: > > > > > > On 2018年02月28日 12:09, Michael S. Tsirkin wrote: > > > > > > Or we can add plist to a union: > > > > > >

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Jason Wang
On 2018年02月28日 22:01, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a union: struct sk_buff { union { struct { /* These

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Jason Wang
On 2018年02月28日 22:01, Michael S. Tsirkin wrote: On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a union: struct sk_buff { union { struct { /* These

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: > > > On 2018年02月28日 12:09, Michael S. Tsirkin wrote: > > > > Or we can add plist to a union: > > > > > > > > > > > > struct sk_buff { > > > > union { > > > > struct { > > > > /*

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 02:28:21PM +0800, Jason Wang wrote: > > > On 2018年02月28日 12:09, Michael S. Tsirkin wrote: > > > > Or we can add plist to a union: > > > > > > > > > > > > struct sk_buff { > > > > union { > > > > struct { > > > > /*

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a union: struct sk_buff { union { struct { /* These two members must be first. */ struct sk_buff *next;

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 12:09, Michael S. Tsirkin wrote: Or we can add plist to a union: struct sk_buff { union { struct { /* These two members must be first. */ struct sk_buff *next;

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 11:39:15AM +0800, Jason Wang wrote: > > > On 2018年02月28日 11:28, Jason Wang wrote: > > > > Well I believe the main user for this is qdisc, which use skb > > > > array. And we > > > > can not use what implemented in this patch directly for sk_buff > > > > without some > > >

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 11:39:15AM +0800, Jason Wang wrote: > > > On 2018年02月28日 11:28, Jason Wang wrote: > > > > Well I believe the main user for this is qdisc, which use skb > > > > array. And we > > > > can not use what implemented in this patch directly for sk_buff > > > > without some > > >

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 11:28:57AM +0800, Jason Wang wrote: > > > On 2018年02月28日 01:12, Michael S. Tsirkin wrote: > > On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: > > > > > > On 2018年02月27日 04:34, Michael S. Tsirkin wrote: > > > > On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 11:28:57AM +0800, Jason Wang wrote: > > > On 2018年02月28日 01:12, Michael S. Tsirkin wrote: > > On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: > > > > > > On 2018年02月27日 04:34, Michael S. Tsirkin wrote: > > > > On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 11:28, Jason Wang wrote: Well I believe the main user for this is qdisc, which use skb array. And we can not use what implemented in this patch directly for sk_buff without some changes on the data structure. Why not? skb has next and prev pointers at 1st two fields: struct

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 11:28, Jason Wang wrote: Well I believe the main user for this is qdisc, which use skb array. And we can not use what implemented in this patch directly for sk_buff without some changes on the data structure. Why not? skb has next and prev pointers at 1st two fields: struct

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 01:12, Michael S. Tsirkin wrote: On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: On 2018年02月27日 04:34, Michael S. Tsirkin wrote: On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Jason Wang
On 2018年02月28日 01:12, Michael S. Tsirkin wrote: On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: On 2018年02月27日 04:34, Michael S. Tsirkin wrote: On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Tue, Feb 27, 2018 at 09:53:49AM -0800, Eric Dumazet wrote: > On Mon, 2018-02-26 at 03:17 +0200, Michael S. Tsirkin wrote: > > So pointer rings work fine, but they have a problem: make them too small > > and not enough entries fit. Make them too large and you start flushing > > your cache and

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Tue, Feb 27, 2018 at 09:53:49AM -0800, Eric Dumazet wrote: > On Mon, 2018-02-26 at 03:17 +0200, Michael S. Tsirkin wrote: > > So pointer rings work fine, but they have a problem: make them too small > > and not enough entries fit. Make them too large and you start flushing > > your cache and

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Eric Dumazet
On Mon, 2018-02-26 at 03:17 +0200, Michael S. Tsirkin wrote: > So pointer rings work fine, but they have a problem: make them too small > and not enough entries fit. Make them too large and you start flushing > your cache and running out of memory. > > This is a new idea of mine: a ring backed

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Eric Dumazet
On Mon, 2018-02-26 at 03:17 +0200, Michael S. Tsirkin wrote: > So pointer rings work fine, but they have a problem: make them too small > and not enough entries fit. Make them too large and you start flushing > your cache and running out of memory. > > This is a new idea of mine: a ring backed

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: > > > On 2018年02月27日 04:34, Michael S. Tsirkin wrote: > > On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: > > > On 2018年02月26日 09:17, Michael S. Tsirkin wrote: > > > > So pointer rings work fine, but they have a problem:

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-27 Thread Michael S. Tsirkin
On Tue, Feb 27, 2018 at 10:29:26AM +0800, Jason Wang wrote: > > > On 2018年02月27日 04:34, Michael S. Tsirkin wrote: > > On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: > > > On 2018年02月26日 09:17, Michael S. Tsirkin wrote: > > > > So pointer rings work fine, but they have a problem:

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-26 Thread Jason Wang
On 2018年02月27日 04:34, Michael S. Tsirkin wrote: On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-26 Thread Jason Wang
On 2018年02月27日 04:34, Michael S. Tsirkin wrote: On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-26 Thread Michael S. Tsirkin
On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: > > > On 2018年02月26日 09:17, Michael S. Tsirkin wrote: > > So pointer rings work fine, but they have a problem: make them too small > > and not enough entries fit. Make them too large and you start flushing > > your cache and running

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-26 Thread Michael S. Tsirkin
On Mon, Feb 26, 2018 at 11:15:42AM +0800, Jason Wang wrote: > > > On 2018年02月26日 09:17, Michael S. Tsirkin wrote: > > So pointer rings work fine, but they have a problem: make them too small > > and not enough entries fit. Make them too large and you start flushing > > your cache and running

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-25 Thread Jason Wang
On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start flushing your cache and running out of memory. This is a new idea of mine: a ring backed by a linked list.

Re: [RFC PATCH v2] ptr_ring: linked list fallback

2018-02-25 Thread Jason Wang
On 2018年02月26日 09:17, Michael S. Tsirkin wrote: So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start flushing your cache and running out of memory. This is a new idea of mine: a ring backed by a linked list.

[RFC PATCH v2] ptr_ring: linked list fallback

2018-02-25 Thread Michael S. Tsirkin
So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start flushing your cache and running out of memory. This is a new idea of mine: a ring backed by a linked list. Once you run out of ring entries, instead of a drop

[RFC PATCH v2] ptr_ring: linked list fallback

2018-02-25 Thread Michael S. Tsirkin
So pointer rings work fine, but they have a problem: make them too small and not enough entries fit. Make them too large and you start flushing your cache and running out of memory. This is a new idea of mine: a ring backed by a linked list. Once you run out of ring entries, instead of a drop