From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: idle linux guest takes up to 8.5% of host CPU Date: Mon, 23 Jul 2007 09:52:15 +0300 Message-ID: <46A4501F.3060006@qumranet.com> References: <9ebd65110707220739j761ada89wec0eb8194b63e8d0@mail.gmail.com> <46A36F9C.3030809@qumranet.com> <9ebd65110707221850w2055632va8c53c989c651020@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Adam Monsen Return-path: In-Reply-To: <9ebd65110707221850w2055632va8c53c989c651020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Adam Monsen wrote: > Hi Avi, > > On 7/22/07, Avi Kivity wrote: > >> Adam Monsen wrote: >> > [...] > >>> Any idea why an idle Fedora 7 guest would use more host CPU than an >>> idle Windows XP guest? >>> >> Several reasons: >> >> - Linux userspace sucks up more cpu than Windows. That's especially >> true if you have X running. >> > > This is a very minimal F7 install... no X, basically just an Apache > HTTP server with mod_mono. > > >> - If running a 64-bit kernel, Linux is running at 250Hz or 300Hz whereas >> Windows runs at 100Hz unless you're doing multimedia. F7 32-bit kernels >> adjust the timer dynamically. >> > > I'm pretty sure I'm running a 32-bit kernel on the host; > "CONFIG_X86_32" is defined in the kernel options, and "getconf > LONG_BIT" returns 32. Same for the Linux guest. > > According to the Intel Web site ( > http://www.intel.com/products/processor_number/chart/pentium_d.htm ) > my processor supports "Intel(r) 64", but I don't think it is truly a > "64-bit processor". > > >> - If your machine is idle, it scales down the clock frequency, making >> guest idle usage seem higher (that doesn't account for the difference >> between Linux and Windows, though). >> >> That said, I usually see much lower numbers. Maybe you have an older >> cpu. >> > > Could be, depending on how old is old. > > Dell tells me I bought a "Dual Core Pentium D, 930 Processor, 2X2MB > Cache, 3.0GHz 800MHz Front Side Bus". It came as part of a Dell > PowerEdge 830 package; the cheapest I could find that supported Intel > VT. > In terms of the VT lifetime, that's old. I think these are the first processors to have featured VT. You can try downloading the latest kvm package, and do ./configure --with-patched-kernel make -C user user/kvmctl user/test/bootstrap user/test/vmexit.flat That will give you the cost (in cycles) of a guest<->host switch. (btw, you're running the distro kernel, right? I don't know how current the kvm version there is) -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/