diff options
Diffstat (limited to 'include/linux/cgroup-defs.h')
-rw-r--r-- | include/linux/cgroup-defs.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 8492721b39be..4d8fcf2187dc 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h | |||
@@ -473,8 +473,31 @@ struct cgroup_subsys { | |||
473 | unsigned int depends_on; | 473 | unsigned int depends_on; |
474 | }; | 474 | }; |
475 | 475 | ||
476 | void cgroup_threadgroup_change_begin(struct task_struct *tsk); | 476 | extern struct percpu_rw_semaphore cgroup_threadgroup_rwsem; |
477 | void cgroup_threadgroup_change_end(struct task_struct *tsk); | 477 | |
478 | /** | ||
479 | * cgroup_threadgroup_change_begin - threadgroup exclusion for cgroups | ||
480 | * @tsk: target task | ||
481 | * | ||
482 | * Called from threadgroup_change_begin() and allows cgroup operations to | ||
483 | * synchronize against threadgroup changes using a percpu_rw_semaphore. | ||
484 | */ | ||
485 | static inline void cgroup_threadgroup_change_begin(struct task_struct *tsk) | ||
486 | { | ||
487 | percpu_down_read(&cgroup_threadgroup_rwsem); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * cgroup_threadgroup_change_end - threadgroup exclusion for cgroups | ||
492 | * @tsk: target task | ||
493 | * | ||
494 | * Called from threadgroup_change_end(). Counterpart of | ||
495 | * cgroup_threadcgroup_change_begin(). | ||
496 | */ | ||
497 | static inline void cgroup_threadgroup_change_end(struct task_struct *tsk) | ||
498 | { | ||
499 | percpu_up_read(&cgroup_threadgroup_rwsem); | ||
500 | } | ||
478 | 501 | ||
479 | #else /* CONFIG_CGROUPS */ | 502 | #else /* CONFIG_CGROUPS */ |
480 | 503 | ||