From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDyrb-0000Bs-Hn for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:33:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDyrV-0005vO-Qi for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:33:23 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:51675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDyrV-0005vK-Kk for qemu-devel@nongnu.org; Tue, 18 Sep 2012 10:33:17 -0400 Received: by pbbrp12 with SMTP id rp12so114034pbb.4 for ; Tue, 18 Sep 2012 07:33:16 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50588626.2030109@redhat.com> Date: Tue, 18 Sep 2012 16:33:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1347968442-8860-1-git-send-email-kwolf@redhat.com> <1347968442-8860-15-git-send-email-kwolf@redhat.com> In-Reply-To: <1347968442-8860-15-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 14/16] qcow2: Execute run_dependent_requests() without lock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org Il 18/09/2012 13:40, Kevin Wolf ha scritto: > static void run_dependent_requests(BDRVQcowState *s, QCowL2Meta *m) > { > - /* Take the request off the list of running requests */ > - if (m->nb_clusters != 0) { > - QLIST_REMOVE(m, next_in_flight); > - } > - > /* Restart all dependent requests */ > if (!qemu_co_queue_empty(&m->dependent_requests)) { > - qemu_co_mutex_unlock(&s->lock); > qemu_co_queue_restart_all(&m->dependent_requests); > - qemu_co_mutex_lock(&s->lock); > } The comment and if can go away. Perhaps this patch could be moved earlier in the series? (Just asking, in case the rebase is not too painful). Paolo > } > > @@ -800,10 +793,18 @@ again: > goto again; > } > > + qemu_co_mutex_unlock(&s->lock); > + > + /* Take the request off the list of running requests */ > + if (m->nb_clusters != 0) { > + QLIST_REMOVE(m, next_in_flight); > + } > + > + /* Meanwhile some new dependencies could have accumulated */