Patchwork ISCSI: We need to call qemu_notify_event() everytime we update which events we need to be notified for.

login
register
mail settings
Submitter ronniesahlberg@gmail.com
Date May 22, 2012, 9:56 a.m.
Message ID <1337680596-8485-1-git-send-email-ronniesahlberg@gmail.com>
Download mbox | patch
Permalink /patch/160580/
State New
Headers show

Comments

ronniesahlberg@gmail.com - May 22, 2012, 9:56 a.m.
Otherwise, If we add an event for -is-writeable but the socket is already writeable there may be a short delay before the event callback is actually triggered.

Those delays would in particular hurt performance during BIOS boot and when the GRUB bootloader reads the kernel and initrd.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
---
 block/iscsi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
Paolo Bonzini - May 22, 2012, 12:13 p.m.
Il 22/05/2012 11:56, Ronnie Sahlberg ha scritto:
> Otherwise, If we add an event for -is-writeable but the socket is already writeable there may be a short delay before the event callback is actually triggered.
> 
> Those delays would in particular hurt performance during BIOS boot and when the GRUB bootloader reads the kernel and initrd.
> 
> Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> ---
>  block/iscsi.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index d37c4ee..f956824 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -109,6 +109,13 @@ iscsi_set_events(IscsiLun *iscsilun)
>                             (iscsi_which_events(iscsi) & POLLOUT)
>                             ? iscsi_process_write : NULL,
>                             iscsi_process_flush, iscsilun);
> +
> +    /* If we just added the event for writeable we must call
> +       and the socket is already writeable the callback might
> +       not be invoked until after a short delay unless we call
> +       qemu_notify_event().
> +     */
> +    qemu_notify_event();
>  }
>  
>  static void

Thanks, applied to SCSI branch for 1.1.

Paolo

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index d37c4ee..f956824 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -109,6 +109,13 @@  iscsi_set_events(IscsiLun *iscsilun)
                            (iscsi_which_events(iscsi) & POLLOUT)
                            ? iscsi_process_write : NULL,
                            iscsi_process_flush, iscsilun);
+
+    /* If we just added the event for writeable we must call
+       and the socket is already writeable the callback might
+       not be invoked until after a short delay unless we call
+       qemu_notify_event().
+     */
+    qemu_notify_event();
 }
 
 static void