Coming Underground
« Finding a hackable digital photo frameOpenWRT 10.03 Backfire »

Don't emulate HPET with KVM

Permalink 2010-07-02 20:42, by jaervosz, Categories: General, Gentoo Tips, Gentoo, Universe/English, Opensource , Tags: gentoo, ksm, kvm, server, time

For quite some time I've experienced quite high CPU load on my KVM server with an AMD Athlon X2 BE-2400 CPU. All KVM instances used 10-15% CPU time more or less constantly. Idle load was around the 1.5-3 range (reaching over 160 with dynticks).

I've tried Virtio drivers, KSM, dynticks, time sources and lots of other tweaks, but performance have remained sluggish. Tonight I finally hit jackpot!

My server doesn't have hardware constant_tsc or HPET time source only acpi_pm:

cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
acpi_pm
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
acpi_pm

The simple fix is to add the -no-hpet option to KVM and now everything seems back to normal, with each guest only using 2-4% CPU time when idling (using dynticks on both host and guests).

Note 1: Apparently Windows need HPET timing.
Note 2: I had to disable dynticks for the Linux guests again, otherwise the host load is going crazy during the nightly backup job with loads of 30+.
Note 3: Actually setting the kernel parameter clocksource=jiffies is enough to get back old performance without having to disable HPET emulation.

3 comments »Send a trackback »

Trackback address for this post

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

3 comments

Comment from: Craig [Visitor] · http://candrews.integralblue.com
Wow, that's a great discovery!

It seems like KVM should automagically detect the absence of hpet on the host cpu. Perhaps a bug should be filed against kvm reporting this find and suggesting this functionality?
2010-07-02 @ 23:38
Comment from: jaervosz [Member] Email
It's already been discussed upstream here: http://kerneltrap.org/mailarchive/linux-kvm/2010/3/14/6259558/thread

The conclusions seems to be not to disable it since Windows guests apparently need it.
2010-07-03 @ 19:01
Comment from: mahatma [Visitor] · http://mahatma.bspu.unibel.by
Hint: even your "acpi_pm-only" machine have jiffies clocksource. "clocksource=jiffies" kernel cmdline command will add "jiffies" into available clocksources and make it default (you can change it in any time). Are "jiffies" fix this problem?

May be there are reason to see kernel code in subject to enable (but not set to default) "jiffies" if "acpi_pm" only detected.
2010-07-06 @ 17:15

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Search

Various local stuff

XML Feeds

powered by b2evolution

©2010 by admin

Contact Jaervosz