From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638AbdHJNSU (ORCPT ); Thu, 10 Aug 2017 09:18:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41155 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbdHJNSS (ORCPT ); Thu, 10 Aug 2017 09:18:18 -0400 Subject: Re: [PATCH v2 0/4] KVM: optimize the kvm_vcpu_on_spin To: "Longpeng (Mike)" , Cornelia Huck Cc: pbonzini@redhat.com, rkrcmar@redhat.com, agraf@suse.com, borntraeger@de.ibm.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, james.hogan@imgtec.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, weidong.huang@huawei.com, arei.gonglei@huawei.com, wangxinxin.wang@huawei.com, longpeng.mike@gmail.com, david@redhat.com References: <1502165135-4784-1-git-send-email-longpeng2@huawei.com> <20170808094153.1b5bf8f4@gondolin> <598972E3.1030807@huawei.com> From: Eric Farman Date: Thu, 10 Aug 2017 09:18:09 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <598972E3.1030807@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17081013-0008-0000-0000-0000026CB989 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007519; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000219; SDB=6.00900299; UDB=6.00450715; IPR=6.00680500; BA=6.00005522; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016626; XFM=3.00000015; UTC=2017-08-10 13:18:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081013-0009-0000-0000-000036545C92 Message-Id: <65ce708e-480a-6173-f678-d7934c630439@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-10_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708100218 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/08/2017 04:14 AM, Longpeng (Mike) wrote: > > > On 2017/8/8 15:41, Cornelia Huck wrote: > >> On Tue, 8 Aug 2017 12:05:31 +0800 >> "Longpeng(Mike)" wrote: >> >>> This is a simple optimization for kvm_vcpu_on_spin, the >>> main idea is described in patch-1's commit msg. >> >> I think this generally looks good now. >> >>> >>> I did some tests base on the RFC version, the result shows >>> that it can improves the performance slightly. >> >> Did you re-run tests on this version? > > > Hi Cornelia, > > I didn't re-run tests on V2. But the major difference between RFC and V2 > is that V2 only cache result for X86 (s390/arm needn't) and V2 saves a > expensive operation ( 440-1400 cycles on my test machine ) for X86/VMX. > > So I think V2's performance is at least the same as RFC or even slightly > better. :) > >> >> I would also like to see some s390 numbers; unfortunately I only have a >> z/VM environment and any performance numbers would be nearly useless >> there. Maybe somebody within IBM with a better setup can run a quick >> test? Won't swear I didn't screw something up, but here's some quick numbers. Host was 4.12.0 with and without this series, running QEMU 2.10.0-rc0. Created 4 guests, each with 4 CPU (unpinned) and 4GB RAM. VM1 did full kernel compiles with kernbench, which took averages of 5 runs of different job sizes (I threw away the "-j 1" numbers). VM2-VM4 ran cpu burners on 2 of their 4 cpus. Numbers from VM1 kernbench output, and the delta between runs: load -j 3 before after delta Elapsed Time 183.178 182.58 -0.598 User Time 534.19 531.52 -2.67 System Time 32.538 33.37 0.832 Percent CPU 308.8 309 0.2 Context Switches 98484.6 99001 516.4 Sleeps 227347 228752 1405 load -j 16 before after delta Elapsed Time 153.352 147.59 -5.762 User Time 545.829 533.41 -12.419 System Time 34.289 34.85 0.561 Percent CPU 347.6 348 0.4 Context Switches 160518 159120 -1398 Sleeps 240740 240536 -204 - Eric