Re: [PATCH 0/2][KVM] guest time accounting

Laurent Vivier
2007-08-13T15:36:07Z

[-- Attachment #1.1: Type: text/plain, Size: 1179 bytes --]

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-6ktuUTfB/bM@public.gmane.org --------------
"Software is hard" - Donald Knuth

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org