From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj0h6-0005Oh-3n for qemu-devel@nongnu.org; Thu, 24 Mar 2016 04:32:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj0h2-0002VZ-Tu for qemu-devel@nongnu.org; Thu, 24 Mar 2016 04:32:40 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:58665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj0h2-0002VL-LW for qemu-devel@nongnu.org; Thu, 24 Mar 2016 04:32:36 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 Mar 2016 08:32:35 -0000 Date: Thu, 24 Mar 2016 09:32:30 +0100 From: Cornelia Huck Message-ID: <20160324093230.5a88cd0f.cornelia.huck@de.ibm.com> In-Reply-To: <56F3A31D.5000609@linux.vnet.ibm.com> References: <1458123018-18651-1-git-send-email-famz@redhat.com> <1458123018-18651-5-git-send-email-famz@redhat.com> <20160317150057.GP14062@stefanha-x1.localdomain> <56EAC82A.50907@redhat.com> <20160322125254.GB9749@ad.usersys.redhat.com> <56F18955.4060005@redhat.com> <20160323091009.64eb4cd8.cornelia.huck@de.ibm.com> <56F25D23.5070604@redhat.com> <56F25E0B.2000105@de.ibm.com> <56F3A31D.5000609@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 4/4] virtio-blk: Clean up start/stop with mutex and BH List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tu bo Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, "Michael S. Tsirkin" , Stefan Hajnoczi , qemu-devel@nongnu.org, Christian Borntraeger , Stefan Hajnoczi , Paolo Bonzini On Thu, 24 Mar 2016 16:19:41 +0800 tu bo wrote: > Hi Christian: > > On 03/23/2016 05:12 PM, Christian Borntraeger wrote: > > On 03/23/2016 10:08 AM, Paolo Bonzini wrote: > >> > >> > >> On 23/03/2016 09:10, Cornelia Huck wrote: > >>>> - /* Kick right away to begin processing requests already in vring */ > >>>> - event_notifier_set(virtio_queue_get_host_notifier(s->vq)); > >>>> + vblk->dataplane_started = true; > >>>> > >>>> - /* Get this show started by hooking up our callbacks */ > >>>> + /* Get this show started by hooking up our callbacks. */ > >>>> aio_context_acquire(s->ctx); > >>>> virtio_queue_aio_set_host_notifier_handler(s->vq, s->ctx, true, true); > >>>> aio_context_release(s->ctx); > >>>> + atomic_dec(&s->starting); > >>>> + > >>>> + /* Kick right away to begin processing requests already in vring */ > >>>> + event_notifier_set(virtio_queue_get_host_notifier(s->vq)); > >>> > >>> I'm wondering whether moving this event_notifier_set() masks something? > >>> IOW, may we run into trouble if the event notifier is set from some > >>> other path before the callbacks are set up properly? > >> > >> The reentrancy check should catch that... But: > >> > >> 1) the patch really makes no difference, your fix is enough for me > > > > > > Tu Bo, can you test with master + Cornelias 6 refactoring patches and nothing on top? > > With qemu master + Cornelia's 6 refactoring patches and nothing on top, > I did NOT see crash so far. Cool, thanks for testing! I'll re-send my patches with some added interface doc in patch 1. Stay tuned.