From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH 2/3] KVM: Centralize slots_lock aquisition during KVM_CREATE_IRQCHIP Date: Thu, 16 Dec 2010 18:47:34 +0900 Message-ID: <4D09E036.2090705@oss.ntt.co.jp> References: <20101216013917.a8a8bab9.takuya.yoshikawa@gmail.com> <20101216014326.9210211a.takuya.yoshikawa@gmail.com> <4D09D7DF.3010209@redhat.com> <4D09DBFB.1080103@oss.ntt.co.jp> <4D09DD3F.5070408@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org, kvm-ia64@vger.kernel.org To: Avi Kivity Return-path: Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:57521 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885Ab0LPJol (ORCPT ); Thu, 16 Dec 2010 04:44:41 -0500 In-Reply-To: <4D09DD3F.5070408@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: (2010/12/16 18:34), Avi Kivity wrote: >>> 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. > Ah, would you mind updating the comments? - or just removing outdated ones? I will reread these locking based on your answer! Thanks, Takuya