]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cgroup: Fix rootcg cpu.stat guest double counting
authorDan Schatzberg <schatzberg.dan@gmail.com>
Thu, 28 Oct 2021 22:15:27 +0000 (15:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:19 +0000 (11:04 +0100)
commit4c4491e856a0eba4e8f889a17a20d57c80f7a219
treeb4fc1b4a3f731f336ac6663dc5bb54cd3a0f40b7
parent2e510c2625230d9502c69dd771dc58397f6ba7cd
cgroup: Fix rootcg cpu.stat guest double counting

[ Upstream commit 81c49d39aea8a10e6d05d3aa1cb65ceb721e19b0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/cgroup/rstat.c