Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbbHNXhz (ORCPT ); Fri, 14 Aug 2015 19:37:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbbHNXhx (ORCPT ); Fri, 14 Aug 2015 19:37:53 -0400 Subject: Re: [PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org References: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> Cc: kvm@vger.kernel.org, Christian Borntraeger From: Paolo Bonzini Message-ID: <55CE7BCC.5090308@redhat.com> Date: Sat, 15 Aug 2015 01:37:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2431 Lines: 60 On 14/08/2015 12:08, Radim Krčmář wrote: > 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] > > QEMU uses SIGUSR1 to force a userspace exit and also to queue an early > exit before calling VCPU_RUN -- the signal is blocked in user space and > 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. > > This series allows the same with a new request bit and VM IOCTL that > marks and kicks target VCPU, hence no need to unblock. > > 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 system > and the speedup was around 35% when utilizing more nodes.) > > Radim Krčmář (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 > > 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(-) > Reviewed-by: Paolo Bonzini ... however, we still need to decide what to do about machine-check exceptions before enabling the capability, otherwise we'd need a new KVM_CAP_USER_EXIT_MCE capability in the future. So I'm holding up the patches for now. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/