vtime accounting

Christoffer Dall
2017-03-08T12:48:32Z

Hi Paolo,

I'm looking at improving KVM/ARM a bit by calling guest_exit_irqoff
before enabling interrupts when coming back from the guest.

Unfortunately, this appears to mess up my view of CPU usage using
something like htop on the host, because it appears all time is spent
inside the kernel.

>From my analysis, I think this is because we never handle any interrupts
before enabling interrupts, where the x86 code does its
handle_external_intr, and the result on ARM is that we never increment
jiffies before doing the vtime accounting.

So my current idea is to increment jiffies according to the clocksource
before calling guest_exit_irqoff, but this would require some main
clocksource infrastructure changes.

My question is: how important is the vtime accounting on the host from
your point of view? Worth poking the timekeeping folks about or even
trying to convince ourselves that the handle_external_intr thing is
worth it?

Thanks,
-Christoffer