From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgqda-0005TZ-FA for qemu-devel@nongnu.org; Fri, 07 Dec 2012 00:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgqdX-0002ky-3O for qemu-devel@nongnu.org; Fri, 07 Dec 2012 00:38:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgqdW-0002kl-S8 for qemu-devel@nongnu.org; Fri, 07 Dec 2012 00:38:11 -0500 Date: Thu, 6 Dec 2012 15:03:56 +0100 From: Stefan Hajnoczi Message-ID: <20121206140356.GC2241@stefanha-thinkpad.muc.redhat.com> References: <1354740430-22452-1-git-send-email-stefanha@redhat.com> <1354740430-22452-11-git-send-email-stefanha@redhat.com> <50C04ADB.9040402@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50C04ADB.9040402@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 10/11] dataplane: add virtio-blk data plane code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Blue Swirl , khoa@us.ibm.com, asias@redhat.com On Thu, Dec 06, 2012 at 08:35:55AM +0100, Paolo Bonzini wrote: > Il 05/12/2012 21:47, Stefan Hajnoczi ha scritto: > > + > > +/* Block until pending requests have completed > > + * > > + * The vring continues to be serviced so ensure no new requests will be added > > + * to avoid races. > > + */ > > +void virtio_blk_data_plane_drain(VirtIOBlockDataPlane *s) > > +{ > > + qemu_mutex_lock(&s->num_reqs_lock); > > + while (s->num_reqs > 0) { > > + qemu_cond_wait(&s->no_reqs_cond, &s->num_reqs_lock); > > + } > > + qemu_mutex_unlock(&s->num_reqs_lock); > > +} > > Hi Stefan, > > so this was not changed from v4? It's unchanged. From the v5 cover letter: * Note I did not get rid of the mutex+condvar approach to draining requests. I've had good feedback on the performance of the patch series so I'm not worried about eliminating the lock (it's very rarely contended). Hope Michael and Paolo are okay with this approach. Stefan