I'm running an Ubuntu 16.04 server with KVM/libvirt/qemu and Windows 10 virtual machine. After upgrading Windows 10 to the latest 1803 version (April 2018 Update), i noticed a slowdown in the VM responsiveness and a too high CPU load in the host. The tests I did:

  • "top" used on the host reports that the qemu-system-x86 process is taking 38-44% of CPU, while the VM is idle and reporting 4-6% of load inside windows process manager. When windows shows 50% of CPU load, the host shows 150-200% cpu load for the qemu-system-x86 process. This 8-10x increase in host CPU load does not occur with the old windows 10 1709 VM.
  • "dstat" on the host reports a lot of system->csw, about 13k.
  • I tested another system with the same setup with an AMD FX-4300, Ubuntu 17.10 dekstop + kvm, upgraded windows 10 to 1803 and I have the same problem of high host CPU and dstat-csw also on this machine.
  • I took a third machine with an intel core i7, installed a new Ubuntu 18.04 desktop + kvm, installed a fresh new Windows 10, installed Virtio drivers available from here and I have the same high cpu problem.

What can I do? Am I using the right virtio drivers?

Thank you

  • Are you sure you interpret this properly? If you have 8 Cores, and assign 8 cores to your vm, 25% load on windows will be a load of 2.0 on your host, which might show as 200%, because it's using 2 "CPU" by 100% each. May 9 '18 at 11:29
  • I have 4 cores on the host with Ubuntu 17.10, 2coresx2threads=4 on the host with Ubuntu 16.04. VM are configured all with 2 cores. I expect to find load of qemu-system-x86 on the host a bit higher than 2*windowsVMLoad. And this is still true on the backup I have of the vm with windows 10 1709: 3%windows cpu load gives 9% of qemu-system-x86 load on the ubuntu host. When I power off the old 1709VM and power on the new 1803 one, I wait it to be idle, and then windows has 6-7% load (never reached 3%), at the same time qemu-system-x86 on the host ranges from 44% to 54%.
    – giox069
    May 9 '18 at 16:28
  • Also reported here by another user: lime-technology.com/forums/topic/71479-windows-10-vm-cpu-usage
    – giox069
    May 24 '18 at 8:35

Found someone with the same issue and a possible fix for it here: https://forum.proxmox.com/threads/high-cpu-load-for-windows-10-guests-when-idle.44531/

Tested changing my own config, and setting hpet to yes in the vm xml fixed it for me.

  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
    <timer name='hypervclock' present='yes'/>

hpet part is important.

  • It works! Host CPU load is reduced a lot. I have also found another post on reddit which suggested to remove the following parameters from qemu commandline: -no-hpet -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard which translates into a slightly different .xml for libvirtd: <timer name='rtc' tickpolicy='delay'/> <timer name='pit' tickpolicy='catchup'/> <timer name='hpet' present='yes'/> Also with the above rtc/pit settings host cpu usage is reduced. VM general performances seems to be a bit lower than windows 1709.
    – giox069
    Jun 17 '18 at 21:30
  • It also seems that <timer name='pit' tickpolicy='discard'/> (instead of 'delay') improves general VM performances. Ubuntu 16.04 does not support it. I upgraded to 18.04.
    – giox069
    Aug 8 '18 at 22:54
  • 1
    for me enabling <synic state='on'> and <stimer state='on'> lowered the cpu usage to under 3%, with almost all cycles used by kernel kvm threads (looking at threads with top, qemu-kvm-ev uses zero cpu on rhel7.5 and kernel 4.16 from fedora28 for a q35 uefi win10 vm); source bugs.launchpad.net/qemu/+bug/1775702 Aug 29 '18 at 21:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.