From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Thu, 16 Dec 2010 09:34:55 +0000 Subject: Re: [PATCH 2/3] KVM: Centralize slots_lock aquisition during KVM_CREATE_IRQCHIP Message-Id: <4D09DD3F.5070408@redhat.com> List-Id: References: <20101216014326.9210211a.takuya.yoshikawa@gmail.com> In-Reply-To: <20101216014326.9210211a.takuya.yoshikawa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ia64@vger.kernel.org On 12/16/2010 11:29 AM, Takuya Yoshikawa wrote: >> and here, the reader might wonder why we don't take slots_lock, which >> protects io_bus. >> >> Maybe we ought to move slots_lock acquisition to >> kvm_io_bus_register() and friends. >> > > > So it will move the lock acquisition to the opposite ( callee ) side > than mine. > At first, I tried to do that, but there are so many ... > > Anyway, your suggestion seems to be the best way if possible. > > > One question: how about kvm_io_bus_[read|write] ? > > These are called from the emulator but I could not find where slots_lock > are held though I can see the comments > > "kvm_io_bus_[read|write] - called under kvm->slots_lock" > They're under srcu now, the comments are outdated. We used to have slots_lock be a rwsem, taken for read or write as necessary. Now we use srcu for read, and the slots_lock mutex + synchronize_srcu for write. -- error compiling committee.c: too many arguments to function