Commit 4148be7d authored by Wei Yang's avatar Wei Yang Committed by Tejun Heo
Browse files

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: default avatarWei Yang <richard.weiyang@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent daadb3bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */