]> nv-tegra.nvidia Code Review - linux-2.6.git/commit
sched: guest CPU accounting: maintain stats in account_system_time()
authorLaurent Vivier <Laurent.Vivier@bull.net>
Mon, 15 Oct 2007 15:00:19 +0000 (17:00 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 15 Oct 2007 15:00:19 +0000 (17:00 +0200)
commit94886b84b1bcdc95f34f70e7fce407efefe472e1
treefe612688c702061cf04441350f9200a08f1dc28d
parent9ac52315d4cf5f561f36dabaf0720c00d3553162
sched: guest CPU accounting: maintain stats in account_system_time()

modify account_system_time() to add cputime to cpustat->guest if we are
running a VCPU. We add this cputime to cpustat->user instead of
cpustat->system because this part of KVM code is in fact user code
although it is executed in the kernel. We duplicate VCPU time between
guest and user to allow an unmodified "top(1)" to display correct value.
A modified "top(1)" is able to display good cpu user time and cpu guest
time by subtracting cpu guest time from cpu user time. Update "gtime" in
task_struct accordingly.

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Acked-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/sched.c