diff options
author | Laurent Vivier <Laurent.Vivier@bull.net> | 2007-10-15 11:00:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:19 -0400 |
commit | 94886b84b1bcdc95f34f70e7fce407efefe472e1 (patch) | |
tree | fe612688c702061cf04441350f9200a08f1dc28d /include | |
parent | 9ac52315d4cf5f561f36dabaf0720c00d3553162 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index fefce22e4c16..228e0a8ce248 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1342,6 +1342,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
1342 | #define PF_STARTING 0x00000002 /* being created */ | 1342 | #define PF_STARTING 0x00000002 /* being created */ |
1343 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1343 | #define PF_EXITING 0x00000004 /* getting shut down */ |
1344 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1344 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
1345 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ | ||
1345 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1346 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
1346 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1347 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
1347 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1348 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |