From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian =?iso-8859-1?q?Borntr=E4ger?= Subject: Re: [patch 0/4] move irq protection role to separate lock v2 Date: Thu, 21 May 2009 08:55:53 +0200 Message-ID: <200905210855.53470.borntrae@de.ibm.com> References: <4A1413C3.4020606@redhat.com> <20090520184841.954066003@localhost.localdomain> <20090521045015.GA1104@amt.cnet> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Christian Borntraeger To: Marcelo Tosatti , Christian Ehrhardt , Carsten Otte Return-path: Received: from mtagate8.de.ibm.com ([195.212.29.157]:55802 "EHLO mtagate8.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbZEUGzy (ORCPT ); Thu, 21 May 2009 02:55:54 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4L6ttuC265408 for ; Thu, 21 May 2009 06:55:55 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4L6ttxA3096714 for ; Thu, 21 May 2009 08:55:55 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4L6tsaG026617 for ; Thu, 21 May 2009 08:55:54 +0200 In-Reply-To: <20090521045015.GA1104@amt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Am Donnerstag 21 Mai 2009 06:50:15 schrieb Marcelo Tosatti: > But I fail to see the case where vcpu creation is a fast path (unless > you're benchmarking cpu hotplug/hotunplug). [...] > @@ -2053,6 +2054,9 @@ static long kvm_vm_ioctl(struct file *fi > > if (kvm->mm != current->mm) > return -EIO; > + > + mutex_lock(&kvm->vm_ioctl_lock); > + > switch (ioctl) { > case KVM_CREATE_VCPU: > r = kvm_vm_ioctl_create_vcpu(kvm, arg); > @@ -2228,6 +2232,7 @@ static long kvm_vm_ioctl(struct file *fi > r = kvm_arch_vm_ioctl(filp, ioctl, arg); > } > out: > + mutex_unlock(&kvm->vm_ioctl_lock); > return r; > } The thing that looks worrysome is that the s390 version of kvm_arch_vm_ioctl has KVM_S390_INTERRUPT. This allows userspace to inject interrupts - which would be serialized. The thing is, that external interrupts and I/O interrupts are floating - which means they can arrive on all cpus. This is somewhat of a fast path. On the other hand, kvm_s390_inject_vm already takes the kvm->lock to protect agains hotplug. With this patch we might be able to remove the kvm->lock in kvm_s390_inject_vm - that would reduce the impact. This needs more thinking on our side. Christian