From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlwc-0007uD-8S for qemu-devel@nongnu.org; Tue, 22 May 2012 06:04:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWlwV-0006DR-TE for qemu-devel@nongnu.org; Tue, 22 May 2012 06:03:57 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:39194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlwV-0006Cr-JZ for qemu-devel@nongnu.org; Tue, 22 May 2012 06:03:51 -0400 Received: by obbwd20 with SMTP id wd20so11775220obb.4 for ; Tue, 22 May 2012 03:03:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4FBA1CC4.7020009@redhat.com> <4FBB5C91.4060504@redhat.com> Date: Tue, 22 May 2012 20:03:49 +1000 Message-ID: From: ronnie sahlberg Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Paolo Bonzini Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel , Stefan Hajnoczi None of the other drivers in block/*.c call qemu_notify_event() Do you you think those should be audited and have this call added to where required ? regards ronnie sahlberg On Tue, May 22, 2012 at 7:48 PM, ronnie sahlberg wrote: > On Tue, May 22, 2012 at 7:29 PM, Paolo Bonzini wrot= e: >> Il 22/05/2012 11:15, ronnie sahlberg ha scritto: >>> Hi, >>> >>> Now that I see what happens, I can easily workaround this in block/iscs= i.c >>> by the patch below, but I dont know if this is the right thing to do. >>> >>> It does appear that here, =A0when 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) >>> =A0{ >>> =A0 =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >>> >>> + =A0 =A0if (iscsi_which_events(iscsi) & POLLOUT) { >>> + =A0 =A0 =A0 =A0iscsi_process_write(iscsilun); >>> + =A0 =A0} >>> + >>> =A0 =A0 =A0qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process_r= ead, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (iscsi_which_ev= ents(iscsi) & POLLOUT) >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ? iscsi_process= _write : NULL, >> >> Doh, now I remember. =A0Whenever you change the aio handlers you need to >> call qemu_notify_event() afterwards, if the handler may fire right away. > > Thanks. =A0I just confirmed that qemu_notify_event() fixes the issue. > Ill send a patch that uses qemu_notify_event() and a comment why this is = needed. > > > regards > ronnie sahlberg