Re: vtime accounting

Paolo Bonzini
2017-03-09T08:23:30Z

On 08/03/2017 11:57, Christoffer Dall wrote:
> 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?

Not really my area, so let's ask Rik. :)

Paolo