summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup
diff options
context:
space:
mode:
authorDan Schatzberg <schatzberg.dan@gmail.com>2021-10-29 00:15:27 +0200
committerTejun Heo <tj@kernel.org>2021-11-01 17:47:08 +0100
commit81c49d39aea8a10e6d05d3aa1cb65ceb721e19b0 (patch)
tree9fae7adcc55b83b9ce6d753ce75dc024c646e797 /kernel/cgroup
parentcgroup: no need for cgroup_mutex for /proc/cgroups (diff)
downloadlinux-81c49d39aea8a10e6d05d3aa1cb65ceb721e19b0.tar.xz
linux-81c49d39aea8a10e6d05d3aa1cb65ceb721e19b0.zip
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: 936f2a70f207 ("cgroup: add cpu.stat file to root cgroup") Signed-off-by: Dan Schatzberg <schatzberg.dan@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r--kernel/cgroup/rstat.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c
index b264ab5652ba..1486768f2318 100644
--- a/kernel/cgroup/rstat.c
+++ b/kernel/cgroup/rstat.c
@@ -433,8 +433,6 @@ static void root_cgroup_cputime(struct task_cputime *cputime)
cputime->sum_exec_runtime += user;
cputime->sum_exec_runtime += sys;
cputime->sum_exec_runtime += cpustat[CPUTIME_STEAL];
- cputime->sum_exec_runtime += cpustat[CPUTIME_GUEST];
- cputime->sum_exec_runtime += cpustat[CPUTIME_GUEST_NICE];
}
}