Re: /proc 2.6.24 changes for guest CPU accounting

From: Michael Kerrisk
Date: Mon Jun 23 2008 - 06:51:25 EST


On Mon, Jun 23, 2008 at 10:48 AM, Laurent Vivier
<Laurent.Vivier@xxxxxxxx> wrote:
> Le dimanche 22 juin 2008 à 09:31 +0200, Michael Kerrisk a écrit :
>> Hi Laurent,
>
> Hi Michael,
>
>> A note and patch from Samuel alerted me to your commits
>> 9ac52315d4cf5f561f36dabaf0720c00d3553162 and
>> 5e84cfde51cf303d368fcb48f22059f37b3872de, which in 2.6.24 changed /proc/stat
>> and /proc/PID/stat. Would you please CC me on kernel-userspace interface
>> changes, so that they have a chance of getting documented in man-pages.
>>
>> (I see that Andrew P tried to get something added to
>> Documentation/filesystems/proc.txt, but that doesn't seem to have made it in.)
>>
>> Below is a patch against the proc.5 man page by Samuel and I to document these
>> changes. Do the changes look okay to you? The first part is the change for
>> /proc/<pid>/stat, and the other is for /proc/stat.
>
> Thank you for that. It seems correct to me (except a typo).
>
> You must also notes that "user time" includes "guest time", if you want
> real "user time" you must subtract "guest time".
> The "guest time" is included in "user time" to not loose it when the
> "reader" is not aware of the "guest time".

Hi Laurent (and Christian)

So, I just want to confirm. You are saying that guest_time and
cguest_time are respectively also included in the following fields

utime %lu
The number of jiffies that this process has been
scheduled in user mode.

[...]

cutime %ld
The number of jiffies that this process's waited-
for children have been scheduled in user mode.
(See also times(2).)

Right?

(In fs/proc/array.c, those are the two lines from

cputime_to_clock_t(utime),
cputime_to_clock_t(cutime),
)

Cheers,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/