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 -- ------------- [email protected] -------------- "Software is hard" - Donald Knuth
Attachment:
signature.asc
Description: OpenPGP digital signature
- References:
- [PATCH 0/2][KVM] guest time accounting
- From: Laurent Vivier <[email protected]>
- Re: [kvm-devel] [PATCH 0/2][KVM] guest time accounting
- From: Avi Kivity <[email protected]>
- Re: [kvm-devel] [PATCH 0/2][KVM] guest time accounting
- From: Laurent Vivier <[email protected]>
- Re: [kvm-devel] [PATCH 0/2][KVM] guest time accounting
- From: Christian Borntraeger <[email protected]>
- [PATCH 0/2][KVM] guest time accounting
- Prev by Date: Re: [PATCH] [384/2many] MAINTAINERS - PPP PROTOCOL DRIVERS AND COMPRESSORS
- Next by Date: [Patch] IPMI: fix warning in ipmi_si_intf.c
- Previous by thread: Re: [kvm-devel] [PATCH 0/2][KVM] guest time accounting
- Next by thread: [PATCH 1/2][KVM] introduce a new field in cpustat
- Index(es):