From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/4] KVM: introduce irq_lock, use it to protect ioapic Date: Sun, 24 May 2009 17:10:07 +0300 Message-ID: <4A19553F.1090903@redhat.com> References: <20090520184841.954066003@localhost.localdomain> <20090520185134.748295218@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, Gregory Haskins To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57787 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbZEXOKI (ORCPT ); Sun, 24 May 2009 10:10:08 -0400 In-Reply-To: <20090520185134.748295218@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Subject says it all. > I hate those changelogs. I guess Subject never reviews code. You might put some evidence that we're suffering from contention here (I'm very willing to believe it, but hard evidence is better). > Signed-off-by: Marcelo Tosatti > > Index: kvm-irqlock/include/linux/kvm_host.h > =================================================================== > --- kvm-irqlock.orig/include/linux/kvm_host.h > +++ kvm-irqlock/include/linux/kvm_host.h > @@ -123,7 +123,6 @@ struct kvm_kernel_irq_routing_entry { > }; > > struct kvm { > - struct mutex lock; /* protects the vcpus array and APIC accesses */ > spinlock_t mmu_lock; > struct rw_semaphore slots_lock; > struct mm_struct *mm; /* userspace tied to this vm */ > @@ -132,6 +131,12 @@ struct kvm { > KVM_PRIVATE_MEM_SLOTS]; > struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; > struct list_head vm_list; > + struct mutex lock; /* > + * - protects mmio_bus, pio_bus. > + * - protects a few concurrent ioctl's (FIXME). > + * - protects concurrent create_vcpu, but > List data structures, not operations. > + * kvm->vcpus walkers do it locklessly (FIXME). > I think we're fine? maybe add an smp_mb() between cpu creation and assignment into the vcpu array? > + */ > struct kvm_io_bus mmio_bus; > struct kvm_io_bus pio_bus; > struct list_head irqfds; > @@ -143,6 +148,7 @@ struct kvm { > struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; > #endif > > + struct mutex irq_lock; /* protects high level irq logic, ioapic */ > List the data structures protected please. -- error compiling committee.c: too many arguments to function