diff options
author | Colin Cross <ccross@android.com> | 2010-11-23 21:37:03 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:09:40 -0700 |
commit | 6d51e762b1b58226ddaf922673970162e71c9ed9 (patch) | |
tree | 25231ef1d676fab8edfeb091daeb6354921c42f8 /include/linux/cgroup.h | |
parent | a0f07aae54e87a9fad6d19c0e57398f54d858f06 (diff) | |
download | kernel_samsung_espresso10-6d51e762b1b58226ddaf922673970162e71c9ed9.zip kernel_samsung_espresso10-6d51e762b1b58226ddaf922673970162e71c9ed9.tar.gz kernel_samsung_espresso10-6d51e762b1b58226ddaf922673970162e71c9ed9.tar.bz2 |
cgroup: Set CGRP_RELEASABLE when adding to a cgroup
Changes the meaning of CGRP_RELEASABLE to be set on any cgroup
that has ever had a task or cgroup in it, or had css_get called
on it. The bit is set in cgroup_attach_task, cgroup_create,
and __css_get. It is not necessary to set the bit in
cgroup_fork, as the task is either in the root cgroup, in
which can never be released, or the task it was forked from
already set the bit in croup_attach_task.
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ab4ac0c..1af8c35 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -84,12 +84,6 @@ enum { CSS_REMOVED, /* This CSS is dead */ }; -/* Caller must verify that the css is not for root cgroup */ -static inline void __css_get(struct cgroup_subsys_state *css, int count) -{ - atomic_add(count, &css->refcnt); -} - /* * Call css_get() to hold a reference on the css; it can be used * for a reference obtained via: @@ -97,6 +91,7 @@ static inline void __css_get(struct cgroup_subsys_state *css, int count) * - task->cgroups for a locked task */ +extern void __css_get(struct cgroup_subsys_state *css, int count); static inline void css_get(struct cgroup_subsys_state *css) { /* We don't need to reference count the root state */ @@ -143,10 +138,7 @@ static inline void css_put(struct cgroup_subsys_state *css) enum { /* Control Group is dead */ CGRP_REMOVED, - /* - * Control Group has previously had a child cgroup or a task, - * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) - */ + /* Control Group has ever had a child cgroup or a task */ CGRP_RELEASABLE, /* Control Group requires release notifications to userspace */ CGRP_NOTIFY_ON_RELEASE, |