From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v4) Date: Mon, 06 Dec 2010 15:27:18 +0200 Message-ID: <4CFCE4B6.1030705@redhat.com> References: <1291473801-23290-1-git-send-email-aliguori@us.ibm.com> <20101205165513.GC440@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , kvm@vger.kernel.org, Marcelo Tosatti , Chris Wright To: vatsa@linux.vnet.ibm.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538Ab0LFN1h (ORCPT ); Mon, 6 Dec 2010 08:27:37 -0500 In-Reply-To: <20101205165513.GC440@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/05/2010 06:55 PM, Srivatsa Vaddagiri wrote: > On Sat, Dec 04, 2010 at 08:43:21AM -0600, Anthony Liguori wrote: > > In certain use-cases, we want to allocate guests fixed time slices where idle > > guest cycles leave the machine idling. There are many approaches to achieve > > this but the most direct is to simply avoid trapping the HLT instruction which > > lets the guest directly execute the instruction putting the processor to sleep. > > A vcpu could be idle not just because of lack of work, but also because its > waiting on IO completion. Normally idle vcpus that yield would allow their > companion threads to run and possibly finish pending IO work faster. Now that > idle vcpu won't yield, it would cause overall cpu cycle demand of VMs to go up > (100% demand from VM's idle/not-idle vcpus + whatever their companion threads > demand) not to mention any impact on IO latencies. Not sure how much of an issue > this will be in practice, but something to keep in mind when we test! It will be an issue. Anything that is latency sensitive will suffer, since the scheduler won't prioritize completions (at least in vcpu threads). But that only affects the average case, not the worst case. > Also, just curious how this would work for idle vcpus that use mwait rather > than hlt. We don't expose mwait to the guest (emulating mwait is very expensive). -- error compiling committee.c: too many arguments to function