diff options
Diffstat (limited to 'include/linux/cgroup.h')
| -rw-r--r-- | include/linux/cgroup.h | 28 | 
1 files changed, 21 insertions, 7 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 665fa70e409..90bba9e6228 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -179,14 +179,11 @@ struct cgroup {  	 */  	struct list_head release_list; -	/* pids_mutex protects the fields below */ +	/* pids_mutex protects pids_list and cached pid arrays. */  	struct rw_semaphore pids_mutex; -	/* Array of process ids in the cgroup */ -	pid_t *tasks_pids; -	/* How many files are using the current tasks_pids array */ -	int pids_use_count; -	/* Length of the current tasks_pids array */ -	int pids_length; + +	/* Linked list of struct cgroup_pids */ +	struct list_head pids_list;  	/* For RCU-protected deletion */  	struct rcu_head rcu_head; @@ -366,6 +363,23 @@ int cgroup_task_count(const struct cgroup *cgrp);  int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);  /* + * When the subsys has to access css and may add permanent refcnt to css, + * it should take care of racy conditions with rmdir(). Following set of + * functions, is for stop/restart rmdir if necessary. + * Because these will call css_get/put, "css" should be alive css. + * + *  cgroup_exclude_rmdir(); + *  ...do some jobs which may access arbitrary empty cgroup + *  cgroup_release_and_wakeup_rmdir(); + * + *  When someone removes a cgroup while cgroup_exclude_rmdir() holds it, + *  it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up. + */ + +void cgroup_exclude_rmdir(struct cgroup_subsys_state *css); +void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); + +/*   * Control Group subsystem type.   * See Documentation/cgroups/cgroups.txt for details   */  |