From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDzKS-0006O7-C3 for qemu-devel@nongnu.org; Tue, 18 Sep 2012 11:03:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDzKH-0000Tp-EQ for qemu-devel@nongnu.org; Tue, 18 Sep 2012 11:03:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDzKH-0000Ti-6I for qemu-devel@nongnu.org; Tue, 18 Sep 2012 11:03:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8IF30uS013596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Sep 2012 11:03:00 -0400 Message-ID: <50588D22.6080703@redhat.com> Date: Tue, 18 Sep 2012 17:02:58 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1347968442-8860-1-git-send-email-kwolf@redhat.com> <1347968442-8860-16-git-send-email-kwolf@redhat.com> <505888CC.8070207@redhat.com> In-Reply-To: <505888CC.8070207@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 15/16] qcow2: Cancel COW when overwritten List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 18.09.2012 16:44, schrieb Paolo Bonzini: > Il 18/09/2012 13:40, Kevin Wolf ha scritto: >> + qemu_co_mutex_unlock(&s->lock); >> + qemu_co_rwlock_wrlock(&m->l2_writeback_lock); > > Can anybody else take the lock as reader again at this point? If not, I > wonder if this is more clear if you write it as a CoQueue. This isn't "let one writer complete, then wake up n readers" (which would indeed be represented more naturally as CoQueue), but rather "let n readers complete, then wake up one writer". Kevin