Re: [PATCH 0/4] Virtual Machine Time Accounting

Laurent Vivier
2007-08-20T14:39:49Z

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

Hi John,

John Stoffel wrote:
>
> Laurent> The aim of these four patches is to introduce Virtual Machine
> Laurent> time accounting.
>
> So what does this buy us? What increased functionality?
>

functionnalities:

- allow to measure time spent by a CPU in a virtual CPU.
- allow to display in /proc/state this value by CPU
- allow to display in /proc/<pid>/state this value by process
- allow KVM to use these 3 previous functionnalities

> Laurent> [PATCH 1/4] as recent CPUs introduce a third running state,
> Laurent> after "user" and "system", we need a new field, "guest", in
> Laurent> cpustat to store the time used by the CPU to run virtual
> Laurent> CPU. Modify /proc/stat to display this new field.
>
> What happens when you have multiple guests, is this state cummulative?

Yes, like system time and user time are.

> I've glanced over these patches and the #ifdefs are ugly..., esp since

#ifdefs are ugly, I agree... I can remove them.
But "#ifdef" allows to save space and time (and it is not a beauty show).

> the overhead seems to exist even if you don't run any Guest CPUs. Or
> whatever you're doing here.

Can you explain ?

> Please justify this patch more in terms of what it provides and why
> it's a good thing to have.

Well... it provides the time spent by CPUs in virtual CPUs.
It is usefull only if you run Virtual Machine on your host (like KVM, lguest,
kqemu...) to know how many time your CPUs dedicate to virtual machine execution.
It's a good thing to have like user time and system time are good things to
have... do you use 'top' or 'time' sometime ?

Laurent
--
------------- Laurent.Vivier@bull.net --------------
"Software is hard" - Donald Knuth

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