From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl Date: Thu, 07 Aug 2014 15:39:31 +0200 Message-ID: <53E38193.8060206@redhat.com> References: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: KVM , Gleb Natapov , Rik van Riel , Raghavendra K T , Michael Mueller To: Christian Borntraeger Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25720 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757454AbaHGNjm (ORCPT ); Thu, 7 Aug 2014 09:39:42 -0400 In-Reply-To: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 05/08/2014 16:44, Christian Borntraeger ha scritto: > We currently track the pid of the task that runs the VCPU in > vcpu_load. Since we call vcpu_load for all kind of ioctls on a > CPU, this causes hickups due to synchronize_rcu if one CPU is > modified by another CPU or the main thread (e.g. initialization, > reset). We track the pid only for the purpose of yielding, so > let's update the pid only in the KVM_RUN ioctl. > > In addition, don't do a synchronize_rcu on startup (pid == 0). Speaking of QEMU, most ioctls should run from the VCPU anyway. Which ioctls do you see called from elsewhere? What speedup can you see if you just do the "no synchronize_rcu on pid == 0" part? The patch may be okay, but I'm worried that it might be hiding a bug in QEMU. Paolo > This speeds up guest boot time on s390 noticably for some configs, e.g. > HZ=100, no full state tracking, 64 guest cpus 32 host cpus.