Patchwork [2/2] virtio-serial-bus: wake up iothread upon guest read notification

login
register
mail settings
Submitter Marcelo Tosatti
Date March 12, 2010, 2:45 a.m.
Message ID <20100312024808.300129379@redhat.com>
Download mbox | patch
Permalink /patch/47660/
State New
Headers show

Comments

Marcelo Tosatti - March 12, 2010, 2:45 a.m.
Wake up iothread when buffers are consumed.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Amit Shah - March 12, 2010, 5:53 a.m.
On (Thu) Mar 11 2010 [23:45:51], Marcelo Tosatti wrote:
> Wake up iothread when buffers are consumed.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> Index: qemu-ioworker/hw/virtio-serial-bus.c
> ===================================================================
> --- qemu-ioworker.orig/hw/virtio-serial-bus.c
> +++ qemu-ioworker/hw/virtio-serial-bus.c
> @@ -331,6 +331,7 @@ static void handle_output(VirtIODevice *
>  
>  static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
>  {
> +    qemu_notify_event(main_io_worker);
>  }

ACK, the host lets us know buffers are consumed and new buffers have
been added to the pool so that we can start sending more data.

Before this patch my tests took 16m18s to run.
After this patch my tests take 1m17s to run.

Both tests done with just one buffer made available in the virtio-queues.

		Amit

Patch

Index: qemu-ioworker/hw/virtio-serial-bus.c
===================================================================
--- qemu-ioworker.orig/hw/virtio-serial-bus.c
+++ qemu-ioworker/hw/virtio-serial-bus.c
@@ -331,6 +331,7 @@  static void handle_output(VirtIODevice *
 
 static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
 {
+    qemu_notify_event(main_io_worker);
 }
 
 static uint32_t get_features(VirtIODevice *vdev, uint32_t features)