cgroup: use cgroup->last_bstat instead of cgroup->bstat_pending for consistency
authorTejun Heo <tj@kernel.org>
Wed, 6 Nov 2019 20:49:57 +0000 (12:49 -0800)
committerTejun Heo <tj@kernel.org>
Wed, 6 Nov 2019 20:50:15 +0000 (12:50 -0800)
commit1bb5ec2eec48dcab1d8ae3707e4a388da6a9c9dc
treeec228819622563e7da1eb8681508c890754ed59a
parent5153faac18d293fc7abb19ff7034683fbcd82dc7
cgroup: use cgroup->last_bstat instead of cgroup->bstat_pending for consistency

cgroup->bstat_pending is used to determine the base stat delta to
propagate to the parent.  While correct, this is different from how
percpu delta is determined for no good reason and the inconsistency
makes the code more difficult to understand.

This patch makes parent propagation delta calculation use the same
method as percpu to global propagation.

* cgroup_base_stat_accumulate() is renamed to cgroup_base_stat_add()
  and cgroup_base_stat_sub() is added.

* percpu propagation calculation is updated to use the above helpers.

* cgroup->bstat_pending is replaced with cgroup->last_bstat and
  updated to use the same calculation as percpu propagation.

Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup-defs.h
kernel/cgroup/rstat.c