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 Date: Thu, 02 Dec 2010 10:43:22 +0200 Message-ID: <4CF75C2A.1080709@redhat.com> References: <1291226627-13664-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Marcelo Tosatti , Chris Wright , Srivatsa Vaddagiri To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28697 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754965Ab0LBIna (ORCPT ); Thu, 2 Dec 2010 03:43:30 -0500 In-Reply-To: <1291226627-13664-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/01/2010 08:03 PM, 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. > > Introduce this as a module-level option for kvm-vmx.ko since if you do this > for one guest, you probably want to do it for all. A similar option is possible > for AMD but I don't have easy access to AMD test hardware. Looks reasonable. > +static int __read_mostly enable_yield_on_guest_hlt = 1; > +module_param(enable_yield_on_guest_hlt, bool, S_IRUGO); > + Please rename to yield_on_hlt. Also, should not be __read_mostly (__read_mostly is for variables that are also __read_often). -- error compiling committee.c: too many arguments to function