]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/cgroup-defs.h
sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem
[mirror_ubuntu-artful-kernel.git] / include / linux / cgroup-defs.h
index 8492721b39be8f0fffa793c5ef39f33d32b5c5fb..4d8fcf2187dcaa822b8f629655e83d667a9913ac 100644 (file)
@@ -473,8 +473,31 @@ struct cgroup_subsys {
        unsigned int depends_on;
 };
 
-void cgroup_threadgroup_change_begin(struct task_struct *tsk);
-void cgroup_threadgroup_change_end(struct task_struct *tsk);
+extern struct percpu_rw_semaphore cgroup_threadgroup_rwsem;
+
+/**
+ * cgroup_threadgroup_change_begin - threadgroup exclusion for cgroups
+ * @tsk: target task
+ *
+ * Called from threadgroup_change_begin() and allows cgroup operations to
+ * synchronize against threadgroup changes using a percpu_rw_semaphore.
+ */
+static inline void cgroup_threadgroup_change_begin(struct task_struct *tsk)
+{
+       percpu_down_read(&cgroup_threadgroup_rwsem);
+}
+
+/**
+ * cgroup_threadgroup_change_end - threadgroup exclusion for cgroups
+ * @tsk: target task
+ *
+ * Called from threadgroup_change_end().  Counterpart of
+ * cgroup_threadcgroup_change_begin().
+ */
+static inline void cgroup_threadgroup_change_end(struct task_struct *tsk)
+{
+       percpu_up_read(&cgroup_threadgroup_rwsem);
+}
 
 #else  /* CONFIG_CGROUPS */