From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl Date: Thu, 07 Aug 2014 11:59:33 +0200 Message-ID: <53E34E05.3050904@de.ibm.com> References: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> <53E3371C.6070209@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , KVM , Gleb Natapov , Rik van Riel , Michael Mueller To: Raghavendra K T Return-path: Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:38102 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757352AbaHGJ7h (ORCPT ); Thu, 7 Aug 2014 05:59:37 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Aug 2014 10:59:36 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id C52E617D8045 for ; Thu, 7 Aug 2014 11:01:20 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s779xYmn30146708 for ; Thu, 7 Aug 2014 09:59:34 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s779xX90012767 for ; Thu, 7 Aug 2014 05:59:34 -0400 In-Reply-To: <53E3371C.6070209@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/08/14 10:21, Raghavendra K T wrote: > 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? The yield code can handle pid == 0, so the new CPU wont be a yield candidate until run for the first time. So I guess this is ok. Paolo, are you willing to apply to kvm/queue? Christian