From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2) Date: Fri, 03 Dec 2010 17:31:40 -0600 Message-ID: <4CF97DDC.3040107@codemonkey.ws> References: <1291298357-5695-1-git-send-email-aliguori@us.ibm.com> <20101202173733.GA26342@amt.cnet> <4CF7EE63.40209@codemonkey.ws> <20101202201223.GA31316@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Avi Kivity , Chris Wright , Srivatsa Vaddagiri To: Marcelo Tosatti Return-path: Received: from mail-gw0-f42.google.com ([74.125.83.42]:58141 "EHLO mail-gw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752680Ab0LCXbm (ORCPT ); Fri, 3 Dec 2010 18:31:42 -0500 Received: by gwb20 with SMTP id 20so5017377gwb.1 for ; Fri, 03 Dec 2010 15:31:41 -0800 (PST) In-Reply-To: <20101202201223.GA31316@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 12/02/2010 02:12 PM, Marcelo Tosatti wrote: >>> It should be possible to achieve determinism with >>> a scheduler policy? >>> >> If the desire is the ultimate desire is to have the guests be >> scheduled in a non-work conserving fashion, I can't see a more >> direct approach that to simply not have the guests yield (which is >> ultimately what hlt trapping does). >> >> Anything the scheduler would do is after the fact and probably based >> on inference about why the yield. >> > Another issue is you ignore the hosts idea of the best way to sleep > (ACPI, or whatever). > Non-work conserving schedulers kill polar bears. There's simply no way around it. The best strategy for power savings is to complete you work as quickly as you can and then spend as much time in the deepest sleep mode you can. If you're using a non-work conserving scheduler, you're going to take more time to complete a workload spending needless cycles in shallow sleep states. But that's the price we pay for determinism. Maybe we can plant some trees at the next KVM Forum to offset CPU limits? :-) > And handling inactive HLT state (which was never enabled) can be painful. > Sorry, I'm not sure what you mean by this. Regards, Anthony Liguori