diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index d8e92223a79c..8675c691d3e2 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/rcupdate.h> | 15 | #include <linux/rcupdate.h> |
16 | #include <linux/cgroupstats.h> | 16 | #include <linux/cgroupstats.h> |
17 | #include <linux/prio_heap.h> | ||
17 | 18 | ||
18 | #ifdef CONFIG_CGROUPS | 19 | #ifdef CONFIG_CGROUPS |
19 | 20 | ||
@@ -207,6 +208,14 @@ struct cftype { | |||
207 | int (*release) (struct inode *inode, struct file *file); | 208 | int (*release) (struct inode *inode, struct file *file); |
208 | }; | 209 | }; |
209 | 210 | ||
211 | struct cgroup_scanner { | ||
212 | struct cgroup *cg; | ||
213 | int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan); | ||
214 | void (*process_task)(struct task_struct *p, | ||
215 | struct cgroup_scanner *scan); | ||
216 | struct ptr_heap *heap; | ||
217 | }; | ||
218 | |||
210 | /* Add a new file to the given cgroup directory. Should only be | 219 | /* Add a new file to the given cgroup directory. Should only be |
211 | * called by subsystems from within a populate() method */ | 220 | * called by subsystems from within a populate() method */ |
212 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, | 221 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, |
@@ -299,11 +308,16 @@ struct cgroup_iter { | |||
299 | * returns NULL or until you want to end the iteration | 308 | * returns NULL or until you want to end the iteration |
300 | * | 309 | * |
301 | * 3) call cgroup_iter_end() to destroy the iterator. | 310 | * 3) call cgroup_iter_end() to destroy the iterator. |
311 | * | ||
312 | * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset. | ||
313 | * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() | ||
314 | * callback, but not while calling the process_task() callback. | ||
302 | */ | 315 | */ |
303 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); | 316 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); |
304 | struct task_struct *cgroup_iter_next(struct cgroup *cont, | 317 | struct task_struct *cgroup_iter_next(struct cgroup *cont, |
305 | struct cgroup_iter *it); | 318 | struct cgroup_iter *it); |
306 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); | 319 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); |
320 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | ||
307 | 321 | ||
308 | #else /* !CONFIG_CGROUPS */ | 322 | #else /* !CONFIG_CGROUPS */ |
309 | 323 | ||