From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srivatsa Vaddagiri Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v4) Date: Sun, 5 Dec 2010 22:25:13 +0530 Message-ID: <20101205165513.GC440@linux.vnet.ibm.com> References: <1291473801-23290-1-git-send-email-aliguori@us.ibm.com> Reply-To: vatsa@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti , Chris Wright To: Anthony Liguori Return-path: Received: from e8.ny.us.ibm.com ([32.97.182.138]:44969 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566Ab0LFEMM (ORCPT ); Sun, 5 Dec 2010 23:12:12 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oB63sTA9000384 for ; Sun, 5 Dec 2010 22:54:29 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id A96544DE803B for ; Sun, 5 Dec 2010 23:10:19 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB64C6ce459330 for ; Sun, 5 Dec 2010 23:12:06 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB64C5K6009774 for ; Sun, 5 Dec 2010 21:12:06 -0700 Content-Disposition: inline In-Reply-To: <1291473801-23290-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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! Also, just curious how this would work for idle vcpus that use mwait rather than hlt. - vatsa