From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl Date: Thu, 07 Aug 2014 13:51:48 +0530 Message-ID: <53E3371C.6070209@linux.vnet.ibm.com> References: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , KVM , Gleb Natapov , Rik van Riel , Michael Mueller To: Christian Borntraeger Return-path: Received: from e28smtp02.in.ibm.com ([122.248.162.2]:43928 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755303AbaHGIYS (ORCPT ); Thu, 7 Aug 2014 04:24:18 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Aug 2014 13:54:15 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 7974A1258018 for ; Thu, 7 Aug 2014 13:54:17 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s778QMYL66650300 for ; Thu, 7 Aug 2014 13:56:22 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s778OBnd029119 for ; Thu, 7 Aug 2014 13:54:12 +0530 In-Reply-To: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/05/2014 08:14 PM, Christian Borntraeger wrote: > 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). > > 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. > > Signed-off-by: Christian Borntraeger > CC: Rik van Riel > CC: Raghavendra K T > CC: Michael Mueller > --- Please feel free to add Reviewed-by: Raghavendra K T I could see very small improvement while testing 32 vcpu guest booting on x86 (16 pcpu host +ht). I was just wondering whether somebody implementing vcpu hot plug would have to bother about this change, but could not see any. What do you think?