diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2022-01-08 00:38:16 +0000 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2022-01-12 09:55:02 -1000 |
commit | 4148be7de0a3316edd1af45609d354cac0e6a021 (patch) | |
tree | f8f9869e16e017edcbb307dd7c45a84f23b820a1 /kernel/cgroup | |
parent | daadb3bd0e8d3e317e36bc2c1542e86c528665e5 (diff) |
cgroup: rstat: use same convention to assign cgroup_base_stat
In function cgroup_base_stat_flush(), we update cgroup_base_stat by
getting rstatc->bstat and adjust delta to related fields.
There are two convention to assign cgroup_base_stat in this function:
* rstat2 = rstat1
* rstat2.cputime = rstat1.cputime
The second convention may make audience think just field "cputime" is
updated, while cputime is the only field in cgroup_base_stat.
Let's use the same convention to eliminate this confusion.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r-- | kernel/cgroup/rstat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index 9d331ba44870..0b32fa62e93c 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -325,7 +325,7 @@ static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu) /* fetch the current per-cpu values */ do { seq = __u64_stats_fetch_begin(&rstatc->bsync); - cur.cputime = rstatc->bstat.cputime; + cur = rstatc->bstat; } while (__u64_stats_fetch_retry(&rstatc->bsync, seq)); /* propagate percpu delta to global */ |