Skip to content

Commit 81c49d3

Browse files
dschatzberghtejun
authored andcommitted
cgroup: Fix rootcg cpu.stat guest double counting
In account_guest_time in kernel/sched/cputime.c guest time is attributed to both CPUTIME_NICE and CPUTIME_USER in addition to CPUTIME_GUEST_NICE and CPUTIME_GUEST respectively. Therefore, adding both to calculate usage results in double counting any guest time at the rootcg. Fixes: 936f2a7 ("cgroup: add cpu.stat file to root cgroup") Signed-off-by: Dan Schatzberg <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 822bc9b commit 81c49d3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/cgroup/rstat.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,6 @@ static void root_cgroup_cputime(struct task_cputime *cputime)
433433
cputime->sum_exec_runtime += user;
434434
cputime->sum_exec_runtime += sys;
435435
cputime->sum_exec_runtime += cpustat[CPUTIME_STEAL];
436-
cputime->sum_exec_runtime += cpustat[CPUTIME_GUEST];
437-
cputime->sum_exec_runtime += cpustat[CPUTIME_GUEST_NICE];
438436
}
439437
}
440438

0 commit comments

Comments
 (0)