public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* idle linux guest takes up to 8.5% of host CPU
@ 2007-07-22 14:39 Adam Monsen
       [not found] ` <9ebd65110707220739j761ada89wec0eb8194b63e8d0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Monsen @ 2007-07-22 14:39 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

I have a Fedora 7 host with two guests:
lnx01: Fedora 7
win01: Windows XP Pro

When they are both active, the host CPU usage by the Linux guest
hovers around 8 to 9 percent, while the host CPU usage by the Windows
guest hovers around 1 to 1.5 percent. These values are seen in the
"virt-manager" application.

Any idea why an idle Fedora 7 guest would use more host CPU than an
idle Windows XP guest?

Thank you,
-Adam

-- 
Adam Monsen

-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: idle linux guest takes up to 8.5% of host CPU
       [not found] ` <9ebd65110707220739j761ada89wec0eb8194b63e8d0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-07-22 14:54   ` Avi Kivity
       [not found]     ` <46A36F9C.3030809-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-07-22 14:54 UTC (permalink / raw)
  To: Adam Monsen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Adam Monsen wrote:
> I have a Fedora 7 host with two guests:
> lnx01: Fedora 7
> win01: Windows XP Pro
>
> When they are both active, the host CPU usage by the Linux guest
> hovers around 8 to 9 percent, while the host CPU usage by the Windows
> guest hovers around 1 to 1.5 percent. These values are seen in the
> "virt-manager" application.
>
> 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.
- 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.
- 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.  Also do look at 
http://kvm.qumranet.com/kvmwiki/Windows_ACPI_Workaround for possibly 
reducing Windows cpu usage further.

When the apic work is merged, I expect idle cpu usage to drop dramatically.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: idle linux guest takes up to 8.5% of host CPU
       [not found]     ` <46A36F9C.3030809-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-23  1:50       ` Adam Monsen
       [not found]         ` <9ebd65110707221850w2055632va8c53c989c651020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Monsen @ 2007-07-23  1:50 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi Avi,

On 7/22/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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.

> Also do look at
> http://kvm.qumranet.com/kvmwiki/Windows_ACPI_Workaround for possibly
> reducing Windows cpu usage further.

Done. That worked like a charm, thanks!

> When the apic work is merged, I expect idle cpu usage to drop dramatically.
[...]

Cool.

-- 
Adam Monsen

-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: idle linux guest takes up to 8.5% of host CPU
       [not found]         ` <9ebd65110707221850w2055632va8c53c989c651020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-07-23  6:52           ` Avi Kivity
       [not found]             ` <46A4501F.3060006-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-07-23  6:52 UTC (permalink / raw)
  To: Adam Monsen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Adam Monsen wrote:
> Hi Avi,
>
> On 7/22/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: idle linux guest takes up to 8.5% of host CPU
       [not found]             ` <46A4501F.3060006-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-23 11:43               ` Adam Monsen
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Monsen @ 2007-07-23 11:43 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 7/22/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> Adam Monsen wrote:
[...]
> > 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.

Ok, I'll give that a shot. I need to build a dev environment first.

> (btw, you're running the distro kernel, right?  I don't know how current
> the kvm version there is)
[...]

Yes.

$ uname -a
Linux fuzzy.evapierce.local 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12
15:37:31 EDT 2007 i686 i686 i386 GNU/Linux

Thanks again for all the useful information. KVM rocks!
-Adam

-- 
Adam Monsen

-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-23 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-22 14:39 idle linux guest takes up to 8.5% of host CPU Adam Monsen
     [not found] ` <9ebd65110707220739j761ada89wec0eb8194b63e8d0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-07-22 14:54   ` Avi Kivity
     [not found]     ` <46A36F9C.3030809-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23  1:50       ` Adam Monsen
     [not found]         ` <9ebd65110707221850w2055632va8c53c989c651020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-07-23  6:52           ` Avi Kivity
     [not found]             ` <46A4501F.3060006-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23 11:43               ` Adam Monsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox