diff options
-rw-r--r-- | include/linux/cgroup.h | 32 | ||||
-rw-r--r-- | kernel/cgroup.c | 32 |
2 files changed, 32 insertions, 32 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index dee53bdb046d..7da3e745b74c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -160,38 +160,6 @@ enum { | |||
160 | CGRP_CLONE_CHILDREN, | 160 | CGRP_CLONE_CHILDREN, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | /* which pidlist file are we talking about? */ | ||
164 | enum cgroup_filetype { | ||
165 | CGROUP_FILE_PROCS, | ||
166 | CGROUP_FILE_TASKS, | ||
167 | }; | ||
168 | |||
169 | /* | ||
170 | * A pidlist is a list of pids that virtually represents the contents of one | ||
171 | * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists, | ||
172 | * a pair (one each for procs, tasks) for each pid namespace that's relevant | ||
173 | * to the cgroup. | ||
174 | */ | ||
175 | struct cgroup_pidlist { | ||
176 | /* | ||
177 | * used to find which pidlist is wanted. doesn't change as long as | ||
178 | * this particular list stays in the list. | ||
179 | */ | ||
180 | struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; | ||
181 | /* array of xids */ | ||
182 | pid_t *list; | ||
183 | /* how many elements the above list has */ | ||
184 | int length; | ||
185 | /* how many files are using the current array */ | ||
186 | int use_count; | ||
187 | /* each of these stored in a list by its cgroup */ | ||
188 | struct list_head links; | ||
189 | /* pointer to the cgroup we belong to, for list removal purposes */ | ||
190 | struct cgroup *owner; | ||
191 | /* protects the other fields */ | ||
192 | struct rw_semaphore mutex; | ||
193 | }; | ||
194 | |||
195 | struct cgroup { | 163 | struct cgroup { |
196 | unsigned long flags; /* "unsigned long" so bitops work */ | 164 | unsigned long flags; /* "unsigned long" so bitops work */ |
197 | 165 | ||
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a5d3b5325f77..6ca7acad7c55 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -3043,6 +3043,38 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan) | |||
3043 | * | 3043 | * |
3044 | */ | 3044 | */ |
3045 | 3045 | ||
3046 | /* which pidlist file are we talking about? */ | ||
3047 | enum cgroup_filetype { | ||
3048 | CGROUP_FILE_PROCS, | ||
3049 | CGROUP_FILE_TASKS, | ||
3050 | }; | ||
3051 | |||
3052 | /* | ||
3053 | * A pidlist is a list of pids that virtually represents the contents of one | ||
3054 | * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists, | ||
3055 | * a pair (one each for procs, tasks) for each pid namespace that's relevant | ||
3056 | * to the cgroup. | ||
3057 | */ | ||
3058 | struct cgroup_pidlist { | ||
3059 | /* | ||
3060 | * used to find which pidlist is wanted. doesn't change as long as | ||
3061 | * this particular list stays in the list. | ||
3062 | */ | ||
3063 | struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; | ||
3064 | /* array of xids */ | ||
3065 | pid_t *list; | ||
3066 | /* how many elements the above list has */ | ||
3067 | int length; | ||
3068 | /* how many files are using the current array */ | ||
3069 | int use_count; | ||
3070 | /* each of these stored in a list by its cgroup */ | ||
3071 | struct list_head links; | ||
3072 | /* pointer to the cgroup we belong to, for list removal purposes */ | ||
3073 | struct cgroup *owner; | ||
3074 | /* protects the other fields */ | ||
3075 | struct rw_semaphore mutex; | ||
3076 | }; | ||
3077 | |||
3046 | /* | 3078 | /* |
3047 | * The following two functions "fix" the issue where there are more pids | 3079 | * The following two functions "fix" the issue where there are more pids |
3048 | * than kmalloc will give memory for; in such cases, we use vmalloc/vfree. | 3080 | * than kmalloc will give memory for; in such cases, we use vmalloc/vfree. |