From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acyTd-0002jB-U0 for qemu-devel@nongnu.org; Mon, 07 Mar 2016 11:57:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acyTd-0001Uu-3a for qemu-devel@nongnu.org; Mon, 07 Mar 2016 11:57:49 -0500 Date: Mon, 7 Mar 2016 17:57:41 +0100 From: Kevin Wolf Message-ID: <20160307165741.GB6464@noname.redhat.com> References: <1455638000-18051-1-git-send-email-pbonzini@redhat.com> <20160217025722.GC30207@ad.usersys.redhat.com> <56C4595D.1020206@redhat.com> <20160223055704.GC19080@ad.usersys.redhat.com> <56CC37EB.7050901@redhat.com> <20160223124956.GA26812@ad.usersys.redhat.com> <56CC647A.6020803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CC647A.6020803@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qed: fix bdrv_qed_drain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-block@nongnu.org, Fam Zheng , qemu-devel@nongnu.org, stefanha@redhat.com, qemu-stable@nongnu.org Am 23.02.2016 um 14:54 hat Paolo Bonzini geschrieben: > > > On 23/02/2016 13:49, Fam Zheng wrote: > > On Tue, 02/23 11:43, Paolo Bonzini wrote: > >> > >> > >> On 23/02/2016 06:57, Fam Zheng wrote: > >>>>>> + qed_cancel_need_check_timer(s); > >>>>>> + qed_need_check_timer_cb(s); > >>>>>> + } > >>>>> > >>>>> What if an allocating write is queued (the else branch case)? Its completion > >>>>> will be in bdrv_drain and it could arm the need_check_timer which is wrong. > >>>>> > >>>>> We need to drain the allocating_write_reqs queue before checking the timer. > >>>> > >>>> You're right, but how? That's what bdrv_drain(bs) does, it's a > >>>> chicken-and-egg problem. > >>> > >>> Maybe use an aio_poll loop before the if? > >> > >> That would not change the fact that you're reimplementing bdrv_drain > >> inside bdrv_qed_drain. > > > > But it fulfills the contract of .bdrv_drain. This is the easy way, the hard way > > would be iterating through the allocating_write_reqs list and process reqs one > > by one synchronously, which still involves aio_poll indirectly. > > The easy way would be better then. > > Stefan, any second opinion? What's the status here? It would be good to have qed not segfaulting all the time. Kevin