| « Finding a hackable digital photo frame | OpenWRT 10.03 Backfire » |
Don't emulate HPET with KVM
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.
Trackback address for this post
3 comments
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?
The conclusions seems to be not to disable it since Windows guests apparently need it.
May be there are reason to see kernel code in subject to enable (but not set to default) "jiffies" if "acpi_pm" only detected.