Re: [PATCH v4 00/12] virtio: s4 support

2011-12-07 Thread Rusty Russell
On Wed, 7 Dec 2011 13:14:56 +0530, Amit Shah wrote: > On (Wed) 07 Dec 2011 [17:54:29], Rusty Russell wrote: > > I figure there's a reason, but it seems a bit weird :) > > Well, there is one reason right now: migrating storage along with > VMs. The guest needs to sync all data to the disk before

Re: [PATCH] macvtap: Fix macvtap_get_queue to use rxhash first

2011-12-07 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 7 Dec 2011 18:10:02 +0200 > On Fri, Nov 25, 2011 at 01:35:52AM -0500, David Miller wrote: >> From: Krishna Kumar2 >> Date: Fri, 25 Nov 2011 09:39:11 +0530 >> >> > Jason Wang wrote on 11/25/2011 08:51:57 AM: >> >> >> >> My description is not clear again :(

Re: [net-next RFC PATCH 0/5] Series short description

2011-12-07 Thread Ben Hutchings
On Wed, 2011-12-07 at 19:31 +0800, Jason Wang wrote: > On 12/07/2011 03:30 PM, Rusty Russell wrote: > > On Mon, 05 Dec 2011 16:58:37 +0800, Jason Wang wrote: > >> multiple queue virtio-net: flow steering through host/guest cooperation > >> > >> Hello all: > >> > >> This is a rough series adds the

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Raghavendra K T
On 12/07/2011 08:22 PM, Avi Kivity wrote: On 12/07/2011 03:39 PM, Marcelo Tosatti wrote: Also I think we can keep the kicked flag in vcpu->requests, no need for new storage. Was going to suggest it but it violates the currently organized processing of entries at the beginning of vcpu_enter_gue

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Raghavendra K T
On 12/07/2011 06:03 PM, Marcelo Tosatti wrote: On Wed, Dec 07, 2011 at 05:24:59PM +0530, Raghavendra K T wrote: On 12/07/2011 04:18 PM, Marcelo Tosatti wrote: Yes you are right. It was potentially racy and it was harmful too!. I had observed that it was stalling the CPU before I introduced kicke

Re: [PATCH] macvtap: Fix macvtap_get_queue to use rxhash first

2011-12-07 Thread Michael S. Tsirkin
On Fri, Nov 25, 2011 at 01:35:52AM -0500, David Miller wrote: > From: Krishna Kumar2 > Date: Fri, 25 Nov 2011 09:39:11 +0530 > > > Jason Wang wrote on 11/25/2011 08:51:57 AM: > >> > >> My description is not clear again :( > >> I mean the same vhost thead: > >> > >> vhost thread #0 transmits pack

Re: [PATCH v4 06/12] virtio: blk: Add freeze, restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 04:26:47PM +0530, Amit Shah wrote: > On (Wed) 07 Dec 2011 [12:37:02], Michael S. Tsirkin wrote: > > On Wed, Dec 07, 2011 at 01:18:44AM +0530, Amit Shah wrote: > > > Delete the vq and flush any pending requests from the block queue on the > > > freeze callback to prepare for

Re: [PATCH v4 04/12] virtio: console: Add freeze and restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 04:29:55PM +0530, Amit Shah wrote: > On (Wed) 07 Dec 2011 [12:43:24], Michael S. Tsirkin wrote: > > > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c > > > index e14f5aa..fd2fd6f 100644 > > > --- a/drivers/char/virtio_console.c > > > +++ b/drive

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 04:02:45PM +0200, Sasha Levin wrote: > On Sun, 2011-12-04 at 20:23 +0200, Sasha Levin wrote: > > [snip] > > Rusty, Michael, does the below looks a reasonable optimization for you? OK overall but a bit hard to say for sure as it looks pretty incomplete ... > should I send

[PATCH RFC] virtio_blk: fix config handler race

2011-12-07 Thread Michael S. Tsirkin
Fix a theoretical race related to config work handler: a config interrupt might happen after we flush config work but before we reset the device. It will then cause the config work to run during or after reset. Two problems with this: - if this runs after device is gone we will get use after free

[PATCH RFC] virtio_net: fix refill related races

2011-12-07 Thread Michael S. Tsirkin
Fix theoretical races related to refill work: 1. After napi is disabled by ndo_stop, refill work can run and re-enable it. 2. Refill can reschedule itself, if this happens it can run after cancel_delayed_work_sync, and will access device after it is destroyed. As a solution, add flags to

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-07 Thread Stefan Hajnoczi
On Wed, Dec 7, 2011 at 12:10 PM, Jason Wang wrote: > On 12/07/2011 05:08 PM, Stefan Hajnoczi wrote: > [...] > >>> >  Consider the complexity of the host nic each with their own steering >>> >  features,  this series make the first step with minimal effort to try >>> > to let >>> >  guest driver an

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Avi Kivity
On 12/07/2011 03:39 PM, Marcelo Tosatti wrote: > > Also I think we can keep the kicked flag in vcpu->requests, no need for > > new storage. > > Was going to suggest it but it violates the currently organized > processing of entries at the beginning of vcpu_enter_guest. > > That is, this "kicked" fl

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-07 Thread Sasha Levin
On Sun, 2011-12-04 at 20:23 +0200, Sasha Levin wrote: [snip] Rusty, Michael, does the below looks a reasonable optimization for you? should I send it as a patch? > Something like the following patch: > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c7a2c20..3

Re: [PATCH v4 00/12] virtio: s4 support

2011-12-07 Thread Dor Laor
On 12/07/2011 12:44 PM, Gleb Natapov wrote: On Wed, Dec 07, 2011 at 05:54:29PM +1030, Rusty Russell wrote: On Wed, 7 Dec 2011 01:18:38 +0530, Amit Shah wrote: Hi, These patches add support for S4 to virtio (pci) and all drivers. Dumb meta-question: why do we want to hibernate virtual machi

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Marcelo Tosatti
On Wed, Dec 07, 2011 at 02:47:05PM +0200, Avi Kivity wrote: > On 12/07/2011 02:33 PM, Marcelo Tosatti wrote: > > > > > > Also Avi pointed that, logically kvm_arch_vcpu_ioctl_set_mpstate should > > > be called only in vcpu thread, so after further debugging, I noticed > > > that, setting vcpuN->mp

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-07 Thread Avi Kivity
On 12/06/2011 02:03 PM, Rusty Russell wrote: > On Tue, 06 Dec 2011 11:58:21 +0200, Avi Kivity wrote: > > On 12/06/2011 07:07 AM, Rusty Russell wrote: > > > Yes, but the hypervisor/trusted party would simply have to do the copy; > > > the rings themselves would be shared A would say "copy this to/f

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Avi Kivity
On 12/07/2011 02:33 PM, Marcelo Tosatti wrote: > > > > Also Avi pointed that, logically kvm_arch_vcpu_ioctl_set_mpstate should > > be called only in vcpu thread, so after further debugging, I noticed > > that, setting vcpuN->mp_state = KVM_MP_STATE_RUNNABLE; is not > > necessary. > > I 'll remove

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Marcelo Tosatti
On Wed, Dec 07, 2011 at 05:24:59PM +0530, Raghavendra K T wrote: > On 12/07/2011 04:18 PM, Marcelo Tosatti wrote: > >On Wed, Nov 30, 2011 at 02:29:59PM +0530, Raghavendra K T wrote: > >> > >>+/* > >>+ * kvm_pv_kick_cpu_op: Kick a vcpu. > >>+ * > >>+ * @cpu - vcpu to be kicked. > >>+ */ > >>+static

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-07 Thread Jason Wang
On 12/07/2011 05:08 PM, Stefan Hajnoczi wrote: [...] > Consider the complexity of the host nic each with their own steering > features, this series make the first step with minimal effort to try to let > guest driver and host tap/macvtap co-operate like what physical nic does. > There may be

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Raghavendra K T
On 12/07/2011 04:18 PM, Marcelo Tosatti wrote: On Wed, Nov 30, 2011 at 02:29:59PM +0530, Raghavendra K T wrote: +/* + * kvm_pv_kick_cpu_op: Kick a vcpu. + * + * @cpu - vcpu to be kicked. + */ +static void kvm_pv_kick_cpu_op(struct kvm *kvm, int cpu) +{ + struct kvm_vcpu *vcpu = kvm_get_v

Re: [PATCH v4 09/12] virtio: net: Add freeze, restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 04:05:29PM +0530, Amit Shah wrote: > On (Wed) 07 Dec 2011 [12:28:24], Michael S. Tsirkin wrote: > > On Wed, Dec 07, 2011 at 01:18:47AM +0530, Amit Shah wrote: > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > > index 697a0fc..1378f3c 100644 > > > ---

Re: [net-next RFC PATCH 0/5] Series short description

2011-12-07 Thread Jason Wang
On 12/07/2011 03:30 PM, Rusty Russell wrote: On Mon, 05 Dec 2011 16:58:37 +0800, Jason Wang wrote: multiple queue virtio-net: flow steering through host/guest cooperation Hello all: This is a rough series adds the guest/host cooperation of flow steering support based on Krish Kumar's multiple

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-07 Thread Jason Wang
On 12/07/2011 07:10 AM, Sridhar Samudrala wrote: On 12/6/2011 8:14 AM, Michael S. Tsirkin wrote: On Tue, Dec 06, 2011 at 07:42:54AM -0800, Sridhar Samudrala wrote: On 12/6/2011 5:15 AM, Stefan Hajnoczi wrote: On Tue, Dec 6, 2011 at 10:21 AM, Jason Wang wrote: On 12/06/2011 05:18 PM, Stefan

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-07 Thread Jason Wang
On 12/06/2011 11:42 PM, Sridhar Samudrala wrote: On 12/6/2011 5:15 AM, Stefan Hajnoczi wrote: On Tue, Dec 6, 2011 at 10:21 AM, Jason Wang wrote: On 12/06/2011 05:18 PM, Stefan Hajnoczi wrote: On Tue, Dec 6, 2011 at 6:33 AM, Jason Wang wrote: On 12/05/2011 06:55 PM, Stefan Hajnoczi wrote:

Re: [PATCH v4 04/12] virtio: console: Add freeze and restore handlers to support S4

2011-12-07 Thread Amit Shah
On (Wed) 07 Dec 2011 [12:43:24], Michael S. Tsirkin wrote: > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c > > index e14f5aa..fd2fd6f 100644 > > --- a/drivers/char/virtio_console.c > > +++ b/drivers/char/virtio_console.c > > @@ -1844,6 +1844,60 @@ static unsigned int

Re: [PATCH v4 06/12] virtio: blk: Add freeze, restore handlers to support S4

2011-12-07 Thread Amit Shah
On (Wed) 07 Dec 2011 [12:37:02], Michael S. Tsirkin wrote: > On Wed, Dec 07, 2011 at 01:18:44AM +0530, Amit Shah wrote: > > Delete the vq and flush any pending requests from the block queue on the > > freeze callback to prepare for hibernation. > > > > Re-create the vq in the restore callback to r

Re: [Xen-devel] [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Avi Kivity
On 12/06/2011 06:49 PM, Konrad Rzeszutek Wilk wrote: > On Sun, Dec 04, 2011 at 11:36:58PM +0530, Raghavendra K T wrote: > > On 12/02/2011 01:20 AM, Raghavendra K T wrote: > > >>Have you tested it on AMD machines? There are some differences in the > > >>hypercall infrastructure there. > > > > > >Yes

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-07 Thread Marcelo Tosatti
On Wed, Nov 30, 2011 at 02:29:59PM +0530, Raghavendra K T wrote: > Add a hypercall to KVM hypervisor to support pv-ticketlocks > > KVM_HC_KICK_CPU allows the calling vcpu to kick another vcpu out of halt > state. > > The presence of these hypercalls is indicated to guest via > KVM_FEATURE_K

Re: [PATCH v4 00/12] virtio: s4 support

2011-12-07 Thread Gleb Natapov
On Wed, Dec 07, 2011 at 05:54:29PM +1030, Rusty Russell wrote: > On Wed, 7 Dec 2011 01:18:38 +0530, Amit Shah wrote: > > Hi, > > > > These patches add support for S4 to virtio (pci) and all drivers. > > Dumb meta-question: why do we want to hibernate virtual machines? > For instance you want t

Re: [PATCH v4 04/12] virtio: console: Add freeze and restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 01:18:42AM +0530, Amit Shah wrote: > Remove all vqs and associated buffers in the freeze callback which > prepares us to go into hibernation state. On restore, re-create all the > vqs and populate the input vqs with buffers to get to the pre-hibernate > state. > > Note: An

Re: (resend) [PATCH v4 12/12] virtio: balloon: Add freeze, restore handlers to support S4

2011-12-07 Thread Amit Shah
On (Wed) 07 Dec 2011 [12:34:48], Michael S. Tsirkin wrote: > On Wed, Dec 07, 2011 at 01:18:50AM +0530, Amit Shah wrote: > > Now to not race with a host issuing ballooning requests while we are in > > the process of freezing, we just exit from the vballoon kthread when the > > processes are asked to

Re: [net-next RFC PATCH 0/5] Series short description

2011-12-07 Thread Rusty Russell
On Mon, 05 Dec 2011 16:58:37 +0800, Jason Wang wrote: > multiple queue virtio-net: flow steering through host/guest cooperation > > Hello all: > > This is a rough series adds the guest/host cooperation of flow > steering support based on Krish Kumar's multiple queue virtio-net > driver patch 3/3

Re: [PATCH v4 09/12] virtio: net: Add freeze, restore handlers to support S4

2011-12-07 Thread Amit Shah
On (Wed) 07 Dec 2011 [12:28:24], Michael S. Tsirkin wrote: > On Wed, Dec 07, 2011 at 01:18:47AM +0530, Amit Shah wrote: > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index 697a0fc..1378f3c 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@

Re: [PATCH v4 06/12] virtio: blk: Add freeze, restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 01:18:44AM +0530, Amit Shah wrote: > Delete the vq and flush any pending requests from the block queue on the > freeze callback to prepare for hibernation. > > Re-create the vq in the restore callback to resume normal function. > > Signed-off-by: Amit Shah > --- > driver

Re: (resend) [PATCH v4 12/12] virtio: balloon: Add freeze, restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 01:18:50AM +0530, Amit Shah wrote: > Now to not race with a host issuing ballooning requests while we are in > the process of freezing, we just exit from the vballoon kthread when the > processes are asked to freeze. Upon thaw and restore, we re-start the > thread. ... >

Re: [PATCH v4 09/12] virtio: net: Add freeze, restore handlers to support S4

2011-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2011 at 01:18:47AM +0530, Amit Shah wrote: > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 697a0fc..1378f3c 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1151,6 +1151,38 @@ static void __devexit virtnet_remove(struct > vir

[no subject]

2011-12-07 Thread Michael S. Tsirkin
Pavel Machek , "Rafael J. Wysocki" , Len Brown , linux...@vger.kernel.org Bcc: Subject: Re: [PATCH v4 12/12] virtio: balloon: Add freeze, restore handlers to support S4 Reply-To: In-Reply-To: <5deccc36afa59032f0e3b10a653773bad511f303.1323199985.git.amit.s...@redhat.com> On Wed, Dec 07, 2011 at

Re: [PATCH v4 01/12] virtio: pci: switch to new PM API

2011-12-07 Thread Rafael J. Wysocki
On Wednesday, December 07, 2011, Amit Shah wrote: > On (Wed) 07 Dec 2011 [10:48:24], Rafael J. Wysocki wrote: > > On Wednesday, December 07, 2011, Amit Shah wrote: > > > Hi Rafael, > > > > > > On (Tue) 06 Dec 2011 [23:12:36], Rafael J. Wysocki wrote: > > > > Hi, > > > > > > > > On Tuesday, Decemb

Re: [PATCH v4 01/12] virtio: pci: switch to new PM API

2011-12-07 Thread Amit Shah
On (Wed) 07 Dec 2011 [10:48:24], Rafael J. Wysocki wrote: > On Wednesday, December 07, 2011, Amit Shah wrote: > > Hi Rafael, > > > > On (Tue) 06 Dec 2011 [23:12:36], Rafael J. Wysocki wrote: > > > Hi, > > > > > > On Tuesday, December 06, 2011, Amit Shah wrote: > > > > The older PM API doesn't hav

Re: [PATCH v4 01/12] virtio: pci: switch to new PM API

2011-12-07 Thread Rafael J. Wysocki
On Wednesday, December 07, 2011, Amit Shah wrote: > Hi Rafael, > > On (Tue) 06 Dec 2011 [23:12:36], Rafael J. Wysocki wrote: > > Hi, > > > > On Tuesday, December 06, 2011, Amit Shah wrote: > > > The older PM API doesn't have a way to get notifications on hibernate > > > events. Switch to the new

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-07 Thread Stefan Hajnoczi
On Wed, Dec 7, 2011 at 3:03 AM, Jason Wang wrote: > On 12/06/2011 09:15 PM, Stefan Hajnoczi wrote: >> >> On Tue, Dec 6, 2011 at 10:21 AM, Jason Wang  wrote: >>> >>> On 12/06/2011 05:18 PM, Stefan Hajnoczi wrote: On Tue, Dec 6, 2011 at 6:33 AM, Jason Wang  wrote: > > On 12/05