aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPaul Menage <[email protected]>2007-10-18 23:39:38 -0700
committerLinus Torvalds <[email protected]>2007-10-19 11:53:36 -0700
commit81a6a5cdd2c5cd70874b88afe524ab09e9e869af (patch)
treeba46c47a0692b687a96e52e61bfda4f14457017f /include/linux
parent817929ec274bcfe771586d338bb31d1659615686 (diff)
Task Control Groups: automatic userspace notification of idle cgroups
Add the following files to the cgroup filesystem: notify_on_release - configures/reports whether the cgroup subsystem should attempt to run a release script when this cgroup becomes unused release_agent - configures/reports the release agent to be used for this hierarchy (top level in each hierarchy only) releasable - reports whether this cgroup would have been auto-released if notify_on_release was true and a release agent was configured (mainly useful for debugging) To avoid locking issues, invoking the userspace release agent is done via a workqueue task; cgroups that need to have their release agents invoked by the workqueue task are linked on to a list. [[email protected]: Need to include kmod.h] Signed-off-by: Paul Menage <[email protected]> Cc: Serge E. Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Paul Jackson <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Herbert Poetzl <[email protected]> Cc: Srivatsa Vaddagiri <[email protected]> Cc: Cedric Le Goater <[email protected]> Signed-off-by: Paul Jackson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cgroup.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 836b3557bb76..9e9b7efa180b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -77,10 +77,11 @@ static inline void css_get(struct cgroup_subsys_state *css)
* css_get()
*/
+extern void __css_put(struct cgroup_subsys_state *css);
static inline void css_put(struct cgroup_subsys_state *css)
{
if (!test_bit(CSS_ROOT, &css->flags))
- atomic_dec(&css->refcnt);
+ __css_put(css);
}
struct cgroup {
@@ -112,6 +113,13 @@ struct cgroup {
* tasks in this cgroup. Protected by css_set_lock
*/
struct list_head css_sets;
+
+ /*
+ * Linked list running through all cgroups that can
+ * potentially be reaped by the release agent. Protected by
+ * release_list_lock
+ */
+ struct list_head release_list;
};
/* A css_set is a structure holding pointers to a set of
@@ -293,7 +301,6 @@ struct task_struct *cgroup_iter_next(struct cgroup *cont,
struct cgroup_iter *it);
void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it);
-
#else /* !CONFIG_CGROUPS */
static inline int cgroup_init_early(void) { return 0; }