In cgroup_base_stat_flush() function, {rstatc, cgrp}->last_bstat needs to be updated to the current {rstatc, cgrp}->bstat, directly assigning values instead of adding the last value to delta. Signed-off-by: Hao Jia <jiahao.os@xxxxxxxxxxxxx> --- kernel/cgroup/rstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index 9c4c55228567..3e5c4c1c92c6 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -376,14 +376,14 @@ static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu) /* propagate percpu delta to global */ cgroup_base_stat_sub(&delta, &rstatc->last_bstat); cgroup_base_stat_add(&cgrp->bstat, &delta); - cgroup_base_stat_add(&rstatc->last_bstat, &delta); + rstatc->last_bstat = rstatc->bstat; /* propagate global delta to parent (unless that's root) */ if (cgroup_parent(parent)) { delta = cgrp->bstat; cgroup_base_stat_sub(&delta, &cgrp->last_bstat); cgroup_base_stat_add(&parent->bstat, &delta); - cgroup_base_stat_add(&cgrp->last_bstat, &delta); + cgrp->last_bstat = cgrp->bstat; } } -- 2.37.0