From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl Date: Wed, 02 Sep 2015 12:31:37 +0200 Message-ID: <55E6D009.9040000@de.ibm.com> References: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org Return-path: Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:56687 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138AbbIBLc0 (ORCPT ); Wed, 2 Sep 2015 07:32:26 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Sep 2015 12:32:21 +0100 In-Reply-To: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 14.08.2015 um 12:08 schrieb Radim Kr=C4=8Dm=C3=A1=C5=99: > v3: > * acked by Christian [1/5] > * use ioctl argument directly (unsigned long as flags) [4/5] > * precisely #ifdef arch-specific ioctls [5/5] > v2: > * move request_exits debug counter patch right after introduction of > KVM_REQ_EXIT [3/5] > * use vcpu ioctl instead of vm one [4/5] > * shrink kvm_user_exit from 64 to 32 bytes [4/5] > * new [5/5] >=20 > QEMU uses SIGUSR1 to force a userspace exit and also to queue an earl= y > exit before calling VCPU_RUN -- the signal is blocked in user space a= nd > temporarily unblocked in VCPU_RUN. > The temporal unblocking by sigprocmask() in kvm_arch_vcpu_ioctl_run() > takes a shared siglock, which leads to cacheline bouncing in NUMA > systems. >=20 > This series allows the same with a new request bit and VM IOCTL that > marks and kicks target VCPU, hence no need to unblock. >=20 > inl_from_{pmtimer,qemu} vmexit benchmark from kvm-unit-tests shows ~5= % > speedup for 1-4 VCPUs (300-2000 saved cycles) without noticeably > regressing kernel VM exits. > (Paolo did a quick run of older version of this series on a NUMA syst= em > and the speedup was around 35% when utilizing more nodes.) >=20 > Radim Kr=C4=8Dm=C3=A1=C5=99 (5): > KVM: add kvm_has_request wrapper > KVM: add KVM_REQ_EXIT request for userspace exit > KVM: x86: add request_exits debug counter > KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit > KVM: refactor asynchronous vcpu ioctl dispatch >=20 > Documentation/virtual/kvm/api.txt | 25 +++++++++++++++++++++++++ > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/kvm/vmx.c | 4 ++-- > arch/x86/kvm/x86.c | 23 +++++++++++++++++++++++ > include/linux/kvm_host.h | 15 +++++++++++++-- > include/uapi/linux/kvm.h | 4 ++++ > virt/kvm/kvm_main.c | 15 ++++++++++----- > 7 files changed, 78 insertions(+), 9 deletions(-) >=20 As far as I can see this should also work for s390 (when we implement=20 REQ_EXIT handling) To double check my understanding: these improvements come with a change= d userspace that does not use KVM_SET_SIGNAL_MASK and therefore this conditional is false if (vcpu->sigset_active) sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); Correct? That also means we improve exits that go to userspace but lightweight e= xits that stay inside the kernel are not affected.=20 Correct? Christian