]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: Add memory barriers to plug cgroup_rstat_updated() race window
authorTejun Heo <tj@kernel.org>
Thu, 26 Apr 2018 21:29:05 +0000 (14:29 -0700)
committerTejun Heo <tj@kernel.org>
Thu, 26 Apr 2018 21:29:05 +0000 (14:29 -0700)
commitd99d4f232670a8883f7f6c761b40b02fb0bb772c
tree3478f3d670cdde6cd9023990c8ebce2e2ecd73a3
parent697d3d50cbac4d67b0636a2c9b030b14d85643ea
cgroup: Add memory barriers to plug cgroup_rstat_updated() race window

cgroup_rstat_updated() has a small race window where an updated
signaling can race with flush and could be lost till the next update.
This wasn't a problem for the existing usages, but we plan to use
rstat to track counters which need to be accurate.

This patch plugs the race window by synchronizing
cgroup_rstat_updated() and flush path with memory barriers around
cgroup_rstat_cpu->updated_next pointer.

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