Inconsistencies on CPU Usage Inside Guest and from KVM

gelbbauch

New Member
Jan 8, 2020
3
0
1
37
Greetings,

This all started as I'm looking to find a replacement for one of my VMs to an upgraded OS for newer software versions. I've been running Centos 7 practically exclusively which has been great. Now that Centos 8 is here, I fired it up.

I came to realize that even with a Cent 8 minimal install and it sitting idle, the Proxmox console is reporting about 5% CPU usage. I thought that was a little high so began investigating. All my Centos 7 minimal VMs are low at about .5% or range <1. Running top though, all the idle VMs report <1%, including the new Centos 8. So that means kvm host and guest on Centos7 are congruent whereas host and guest on Centos 8 has a discrepancy.

After some researching, I found that it might be polling related but this doesn't make much sense since my Centos 7 VMs are unaffected. Just to be sure, I fired up a new 7 one after the 8 and it's still the same low reporting from host and guest as the others. I thought c/p states might be coming into play but after playing around with that and moving to tsc clocksource, didn't have any effect. IRQs didn't seem to be related.

I moved to perf on the host. Tracing the syscalls shows a large variance in context switching between centos 7 and centos 8 kvm processes. Attached is some data on that. It does appear to be polling related but I'm not sure why that would exist for certain VM types and not others.

I also tested Debian 9 and Ubuntu 18 LTS which have the same behavior as Centos 8. I asked a friend who also runs Proxmox and he reports 1% usage on Ubuntu 18 idle.

Questions are:
1. Is this polling or whatever this overhead is expected?
2. Will it adversely affect performance of the overall system? I don't have the most amount of horse power so I'd like to save as many cycles as possible.
3. If this is abnormal, are there any ideas of what I could try to address it?
 

Attachments

  • perfKvmstats.txt
    7.6 KB · Views: 8
Hi,

try to disable "Use tablet for pointer" in the options tab.
 
no, the reason why that problem exists is because systemd developer removed automatic autosuspend activation for a multitude of devices in 06/2015 in systemd.

centos7 is conservative distro and is using systemd-219 which is from 02/2015 , which is only getting cherrypicked patches backported ( see rpm -q --changelog systemd-219 ) , so that problem does not exist in centos7 , but the problem should have entered centos8

see https://github.com/systemd/systemd/pull/353#issuecomment-658810289

and

https://lists.proxmox.com/pipermail/pve-user/2020-July/171861.html

on my recently updated centos8 , i see the new variant of autosuspend activation is in place, so you may have a look if you need updating to have it there, too

# cat /usr/lib/udev/hwdb.d/60-autosuspend.hwdb |grep -C2 Tablet
usb:v0627p0001:*QEMU USB Keyboard*
usb:v0627p0001:*QEMU USB Mouse*
usb:v0627p0001:*QEMU USB Tablet*
ID_AUTOSUSPEND=1


anyhow, i disable "Use tablet for pointer" for every VM where it isn't needed because of this....
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!