aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2018-04-26 14:29:05 -0700
committerTejun Heo <tj@kernel.org>2018-04-26 14:29:05 -0700
commit0fa294fb1985c06c4e3325e30e759d4ca580f59a (patch)
tree41bc9abc473d8df21ab0cb1dca6c1b8746abcacb /include/linux/cgroup.h
parentcgroup: Factor out and expose cgroup_rstat_*() interface functions (diff)
downloadwireguard-linux-0fa294fb1985c06c4e3325e30e759d4ca580f59a.tar.xz
wireguard-linux-0fa294fb1985c06c4e3325e30e759d4ca580f59a.zip
cgroup: Replace cgroup_rstat_mutex with a spinlock
Currently, rstat flush path is protected with a mutex which is fine as all the existing users are from interface file show path. However, rstat is being generalized for use by controllers and flushing from atomic contexts will be necessary. This patch replaces cgroup_rstat_mutex with a spinlock and adds a irq-safe flush function - cgroup_rstat_flush_irqsafe(). Explicit yield handling is added to the flush path so that other flush functions can yield to other threads and flushers. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 5c6018fef5aa..c9fdf6f57913 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -696,6 +696,7 @@ static inline void cgroup_path_from_kernfs_id(const union kernfs_node_id *id,
*/
void cgroup_rstat_updated(struct cgroup *cgrp, int cpu);
void cgroup_rstat_flush(struct cgroup *cgrp);
+void cgroup_rstat_flush_irqsafe(struct cgroup *cgrp);
void cgroup_rstat_flush_hold(struct cgroup *cgrp);
void cgroup_rstat_flush_release(void);