From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: A question about HTL VM-Exit handling time Date: Tue, 28 Oct 2014 08:46:50 +0100 Message-ID: <544F49EA.1090805@de.ibm.com> References: <5446A875.4080204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Xiao Guangrong , Alexander Yarygin To: Paolo Bonzini , "Wu, Feng" , "kvm@vger.kernel.org" Return-path: Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:35488 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754552AbaJ1Hq6 (ORCPT ); Tue, 28 Oct 2014 03:46:58 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Oct 2014 07:46:56 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 39E201B0804B for ; Tue, 28 Oct 2014 07:46:57 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9S7ksgc9896338 for ; Tue, 28 Oct 2014 07:46:54 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9S7kpEr012181 for ; Tue, 28 Oct 2014 01:46:53 -0600 In-Reply-To: <5446A875.4080204@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 21.10.2014 20:39, schrieb Paolo Bonzini: > > > On 10/16/2014 10:15 AM, Wu, Feng wrote: >> Hi folks, >> >> I run kernel build in the guest and use perf kvm to get some VM-Exit result as the following: >> >> Analyze events for all VCPUs: >> >> VM-EXIT Samples Samples% Time% Min Time Max Time A >> >> MSR_WRITE 3613908 57.53% 18.97% 5us 1362us 9.73 >> HLT 1399747 22.28% 74.90% 5us 432448us 99.24 >> CR_ACCESS 961203 15.30% 3.28% 4us 188us 6.33 >> EXTERNAL_INTERRUPT 213821 3.40% 2.25% 4us 4089us 19.54 >> EXCEPTION_NMI 25152 0.40% 0.12% 4us 71us 9.05 >> EPT_MISCONFIG 20104 0.32% 0.15% 8us 5628us 13.74 >> CPUID 19904 0.32% 0.07% 4us 220us 6.90 >> IO_INSTRUCTION 17097 0.27% 0.20% 13us 1008us 22.08 >> PAUSE_INSTRUCTION 10737 0.17% 0.05% 4us 53us 8.33 >> MSR_READ 48 0.00% 0.00% 4us 8us 5.62 >> >> Total Samples:6281721, Total events handled time:185457820.41us. >> >> I also do some other experiments with different workload in the guest, I got the same results in terms of >> HLT VM-Exit handling time. Does anyone know why the handling time for HLT VM-Exit is so high? Appreciate >> You help! > > 432 ms sounds like a lot, but in general it is expected that HLT vmexits > take a long time. After an HLT vmexit, the VCPU will not be reentered > until the next interrupt comes. On hardware, the HLT instruction can > also take many milliseconds. > > If this is an SMP guest, it's possible that the maximum time is > registered on the APs before Linux boots. With a UP guest I would > expect a shorter maximum time, but still longer than other vmexits. We have the same on s390 with wait state. The thing is, with an idle system and NOHZ the time spend in HLT/wait could be really long. So We might want to provide an option to filter this out. (A similar filter already exitis for the --duration option)