From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 2/4] KVM: move coalesced_mmio locking to its own device Date: Wed, 20 May 2009 15:06:26 +0300 Message-ID: <4A13F242.7090404@redhat.com> References: <20090518165601.747763120@localhost.localdomain> <20090518170855.346048603@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:40513 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755507AbZETMG1 (ORCPT ); Wed, 20 May 2009 08:06:27 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4KC6TXD025825 for ; Wed, 20 May 2009 08:06:29 -0400 In-Reply-To: <20090518170855.346048603@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Signed-off-by: Marcelo Tosatti > > Index: kvm/virt/kvm/coalesced_mmio.c > =================================================================== > --- kvm.orig/virt/kvm/coalesced_mmio.c > +++ kvm/virt/kvm/coalesced_mmio.c > @@ -26,9 +26,10 @@ static int coalesced_mmio_in_range(struc > if (!is_write) > return 0; > > - /* kvm->lock is taken by the caller and must be not released before > - * dev.read/write > - */ > + /* > + * dev->lock must not be released before coalesced_mmio_write. > + */ > + mutex_lock(&dev->lock); > > /* Are we able to batch it ? */ > > @@ -41,6 +42,7 @@ static int coalesced_mmio_in_range(struc > KVM_COALESCED_MMIO_MAX; > if (next == dev->kvm->coalesced_mmio_ring->first) { > /* full */ > + mutex_unlock(&dev->lock); > return 0; > } > > @@ -57,6 +59,7 @@ static int coalesced_mmio_in_range(struc > addr + len <= zone->addr + zone->size) > return 1; > } > + mutex_unlock(&dev->lock); > return 0; > } > So we have a function that takes a lock and conditionally releases it? -- error compiling committee.c: too many arguments to function