Skip to content
Commit 94886b84 authored by Laurent Vivier's avatar Laurent Vivier Committed by Ingo Molnar
Browse files

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: default avatarLaurent Vivier <Laurent.Vivier@bull.net>
Acked-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9ac52315
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment