Re: [kvm-devel] [PATCH 0/2][KVM] guest time accounting
From: Laurent Vivier
Date: Mon Aug 13 2007 - 12:32:14 EST
Christian Borntraeger wrote:
> Am Montag, 13. August 2007 schrieb Laurent Vivier:
>>>> As guest accounting is hw dependent, I think we should add a hook in the
>>>> accounting functions.
>>>>
>>> Isn't PF_VM exactly such a hook? All the hypervisor needs to do is to
>>> set/unset it correctly?
>> In fact, no.
>>
>> PF_VM is used to know we have entered a virtual CPU (the hypervisor set it,
>> the scheduler unset it on accounting)
>
> Why not do something like the following. (This patch does not work as it
> relies on the no-existing var cputime_since_last_update, but it shows the
> idea)
Yes, I think it is a really good idea, much more cleaner.
But doing like that you can have cpustat->system decreasing and thus negative
values in "top".
It is why I modify account_system_time() (see my last patch) to decrease the
value to add to system time accordingly the value we add in cpustat->guest, and
thus system time never decreases. We cannot do that when we call
account_system_time() from KVM part.
Laurent
--
------------- Laurent.Vivier@xxxxxxxx --------------
"Software is hard" - Donald Knuth
Attachment:
signature.asc
Description: OpenPGP digital signature