aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 30934e4bfaab..8b00f6643e93 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -9,12 +9,12 @@
9 */ 9 */
10 10
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/kref.h>
13#include <linux/cpumask.h> 12#include <linux/cpumask.h>
14#include <linux/nodemask.h> 13#include <linux/nodemask.h>
15#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
16#include <linux/cgroupstats.h> 15#include <linux/cgroupstats.h>
17#include <linux/prio_heap.h> 16#include <linux/prio_heap.h>
17#include <linux/rwsem.h>
18 18
19#ifdef CONFIG_CGROUPS 19#ifdef CONFIG_CGROUPS
20 20
@@ -137,6 +137,15 @@ struct cgroup {
137 * release_list_lock 137 * release_list_lock
138 */ 138 */
139 struct list_head release_list; 139 struct list_head release_list;
140
141 /* pids_mutex protects the fields below */
142 struct rw_semaphore pids_mutex;
143 /* Array of process ids in the cgroup */
144 pid_t *tasks_pids;
145 /* How many files are using the current tasks_pids array */
146 int pids_use_count;
147 /* Length of the current tasks_pids array */
148 int pids_length;
140}; 149};
141 150
142/* A css_set is a structure holding pointers to a set of 151/* A css_set is a structure holding pointers to a set of
@@ -149,7 +158,7 @@ struct cgroup {
149struct css_set { 158struct css_set {
150 159
151 /* Reference count */ 160 /* Reference count */
152 struct kref ref; 161 atomic_t refcount;
153 162
154 /* 163 /*
155 * List running through all cgroup groups in the same hash 164 * List running through all cgroup groups in the same hash
@@ -394,6 +403,9 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
394int cgroup_scan_tasks(struct cgroup_scanner *scan); 403int cgroup_scan_tasks(struct cgroup_scanner *scan);
395int cgroup_attach_task(struct cgroup *, struct task_struct *); 404int cgroup_attach_task(struct cgroup *, struct task_struct *);
396 405
406void cgroup_mm_owner_callbacks(struct task_struct *old,
407 struct task_struct *new);
408
397#else /* !CONFIG_CGROUPS */ 409#else /* !CONFIG_CGROUPS */
398 410
399static inline int cgroup_init_early(void) { return 0; } 411static inline int cgroup_init_early(void) { return 0; }
@@ -412,15 +424,9 @@ static inline int cgroupstats_build(struct cgroupstats *stats,
412 return -EINVAL; 424 return -EINVAL;
413} 425}
414 426
427static inline void cgroup_mm_owner_callbacks(struct task_struct *old,
428 struct task_struct *new) {}
429
415#endif /* !CONFIG_CGROUPS */ 430#endif /* !CONFIG_CGROUPS */
416 431
417#ifdef CONFIG_MM_OWNER
418extern void
419cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new);
420#else /* !CONFIG_MM_OWNER */
421static inline void
422cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new)
423{
424}
425#endif /* CONFIG_MM_OWNER */
426#endif /* _LINUX_CGROUP_H */ 432#endif /* _LINUX_CGROUP_H */