diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c98dd7cb7076..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 { | |||
149 | struct css_set { | 158 | struct 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 |
@@ -326,7 +335,8 @@ struct cgroup_subsys { | |||
326 | */ | 335 | */ |
327 | void (*mm_owner_changed)(struct cgroup_subsys *ss, | 336 | void (*mm_owner_changed)(struct cgroup_subsys *ss, |
328 | struct cgroup *old, | 337 | struct cgroup *old, |
329 | struct cgroup *new); | 338 | struct cgroup *new, |
339 | struct task_struct *p); | ||
330 | int subsys_id; | 340 | int subsys_id; |
331 | int active; | 341 | int active; |
332 | int disabled; | 342 | int disabled; |
@@ -393,6 +403,9 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | |||
393 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 403 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
394 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 404 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
395 | 405 | ||
406 | void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
407 | struct task_struct *new); | ||
408 | |||
396 | #else /* !CONFIG_CGROUPS */ | 409 | #else /* !CONFIG_CGROUPS */ |
397 | 410 | ||
398 | static inline int cgroup_init_early(void) { return 0; } | 411 | static inline int cgroup_init_early(void) { return 0; } |
@@ -411,15 +424,9 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
411 | return -EINVAL; | 424 | return -EINVAL; |
412 | } | 425 | } |
413 | 426 | ||
427 | static inline void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
428 | struct task_struct *new) {} | ||
429 | |||
414 | #endif /* !CONFIG_CGROUPS */ | 430 | #endif /* !CONFIG_CGROUPS */ |
415 | 431 | ||
416 | #ifdef CONFIG_MM_OWNER | ||
417 | extern void | ||
418 | cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new); | ||
419 | #else /* !CONFIG_MM_OWNER */ | ||
420 | static inline void | ||
421 | cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new) | ||
422 | { | ||
423 | } | ||
424 | #endif /* CONFIG_MM_OWNER */ | ||
425 | #endif /* _LINUX_CGROUP_H */ | 432 | #endif /* _LINUX_CGROUP_H */ |