Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-08 Thread Paul E. McKenney
On Sun, Nov 08, 2009 at 02:39:59PM +1030, Rusty Russell wrote: On Sat, 7 Nov 2009 03:00:07 am Paul E. McKenney wrote: On Fri, Nov 06, 2009 at 03:31:20PM +1030, Rusty Russell wrote: But it's still nasty to use half an API. If it were a few places I would have open-coded it with a comment,

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-07 Thread Rusty Russell
On Sat, 7 Nov 2009 03:00:07 am Paul E. McKenney wrote: On Fri, Nov 06, 2009 at 03:31:20PM +1030, Rusty Russell wrote: But it's still nasty to use half an API. If it were a few places I would have open-coded it with a comment, or wrapped it. As it is, I don't think that would be a win.

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-05 Thread Rusty Russell
On Thu, 5 Nov 2009 03:55:42 am Paul E. McKenney wrote: On Wed, Nov 04, 2009 at 01:57:29PM +0200, Michael S. Tsirkin wrote: Can you ack this usage please? I thought I had done so in my paragraph above, but if you would like something a bit more formal... snip verbose super-ack with

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 10:11:12PM +0100, Eric Dumazet wrote: Michael S. Tsirkin a écrit : Paul, you acked this previously. Should I add you acked-by line so people calm down? If you would rather I replace rcu_dereference/rcu_assign_pointer with rmb/wmb, I can do this. Or maybe patch

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 12:08:47PM +0100, Andi Kleen wrote: Michael S. Tsirkin m...@redhat.com writes: Haven't really read the whole thing, just noticed something at a glance. +/* Expects to be always run from workqueue - which acts as + * read-size critical section for our kind of RCU.

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
Fine? I cannot say -- are there paths that could drop the device beforehand? (as in do you hold a reference to it?) -Andi -- a...@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: Fine? I cannot say -- are there paths that could drop the device beforehand? Do you mean drop the mm reference? (as in do you hold a reference to it?) By design I think I always have a reference to mm before I use it. This works

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: Fine? I cannot say -- are there paths that could drop the device beforehand? Do you mean drop the mm reference? No the reference to the device, which owns

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: Fine? I cannot say -- are there paths that could drop the device beforehand? Do you mean

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: Fine? I cannot say --

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 02:37:28PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 03:41:47PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 02:37:28PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: On Wed, Nov 04, 2009 at

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Paul E. McKenney
On Wed, Nov 04, 2009 at 01:57:29PM +0200, Michael S. Tsirkin wrote: On Tue, Nov 03, 2009 at 03:57:44PM -0800, Paul E. McKenney wrote: On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Eric Dumazet
Paul E. McKenney a écrit : (Sorry, but, as always, I could not resist!) Yes :) Thanks Paul for this masterpiece of diplomatic Acked-by ;) -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 09:25:42AM -0800, Paul E. McKenney wrote: (Sorry, but, as always, I could not resist!) Thanx, Paul Thanks Paul! Jonathan: are you reading this? Another one for your quotes of the week collection :) -- MST -- To

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Wed, Nov 04, 2009 at 09:25:42AM -0800, Paul E. McKenney wrote: (Sorry, but, as always, I could not resist!) Thanx, Paul Thanks Paul! Jonathan: are you reading this? Another one for your quotes of the week

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; + struct msghdr msg = { + .msg_name = NULL, + .msg_namelen = 0, +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; + struct msghdr msg = { + .msg_name = NULL, +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ +struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; +unsigned head, out, in, s; +struct msghdr msg = { +.msg_name = NULL, +.msg_namelen = 0, +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Gregory Haskins a écrit : Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; + struct msghdr msg = { + .msg_name =

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 07:51:35PM +0100, Eric Dumazet wrote: Gregory Haskins a écrit : Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ +struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 07:03:55PM +0100, Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; + struct msghdr msg = { + .msg_name =

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Paul E. McKenney
On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = net-dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Eric Dumazet wrote: Gregory Haskins a écrit : Gregory Haskins wrote: Eric Dumazet wrote: Michael S. Tsirkin a écrit : using rcu_dereference() and mutex_lock() at the same time seems wrong, I suspect that your use of RCU is not correct. 1) rcu_dereference() should be done inside a

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Michael S. Tsirkin a écrit : Paul, you acked this previously. Should I add you acked-by line so people calm down? If you would rather I replace rcu_dereference/rcu_assign_pointer with rmb/wmb, I can do this. Or maybe patch Documentation to explain this RCU usage? So you believe I am