From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlPp-0003ho-JW for qemu-devel@nongnu.org; Tue, 22 May 2012 05:30:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWlPk-0001kj-S9 for qemu-devel@nongnu.org; Tue, 22 May 2012 05:30:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlPk-0001k8-KO for qemu-devel@nongnu.org; Tue, 22 May 2012 05:30:00 -0400 Message-ID: <4FBB5C91.4060504@redhat.com> Date: Tue, 22 May 2012 11:29:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4FBA1CC4.7020009@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Weird iscsi/fd-event issue since recent merge of event system changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ronnie sahlberg Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel , Stefan Hajnoczi Il 22/05/2012 11:15, ronnie sahlberg ha scritto: > Hi, > > Now that I see what happens, I can easily workaround this in block/iscsi.c > by the patch below, but I dont know if this is the right thing to do. > > It does appear that here, when I use qemu_set_fd_handler() and add a > handler for "writeble" it takes 55ms before the event system notices > this and reacts. > > > > diff --git a/block/iscsi.c b/block/iscsi.c > index d37c4ee..1ebff0f 100644 > --- a/block/iscsi.c > +++ b/block/iscsi.c > @@ -105,6 +105,10 @@ iscsi_set_events(IscsiLun *iscsilun) > { > struct iscsi_context *iscsi = iscsilun->iscsi; > > + if (iscsi_which_events(iscsi) & POLLOUT) { > + iscsi_process_write(iscsilun); > + } > + > qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process_read, > (iscsi_which_events(iscsi) & POLLOUT) > ? iscsi_process_write : NULL, Doh, now I remember. Whenever you change the aio handlers you need to call qemu_notify_event() afterwards, if the handler may fire right away. The alternative is your patch, which is correct. Can you resend it with SoB? Paolo