aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-05 12:21:51 -0500
committerTejun Heo <tj@kernel.org>2012-11-05 12:21:51 -0500
commit1db1e31b1ee3ae126ef98f39083b5f213c7b41bf (patch)
tree98328124d3b8b08b6db894c79d0e79b3a42417bf /include/linux/cgroup.h
parent5d8f72b55c275677865de670fa147ed318191d81 (diff)
parentbcf6de1b9129531215d26dd9af8331e84973bc52 (diff)
Merge branch 'cgroup-rmdir-updates' into cgroup/for-3.8
Pull rmdir updates into for-3.8 so that further callback updates can be put on top. This pull created a trivial conflict between the following two commits. 8c7f6edbda ("cgroup: mark subsystems with broken hierarchy support and whine if cgroups are nested for them") ed95779340 ("cgroup: kill cgroup_subsys->__DEPRECATED_clear_css_refs") The former added a field to cgroup_subsys and the latter removed one from it. They happen to be colocated causing the conflict. Keeping what's added and removing what's removed resolves the conflict. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h41
1 files changed, 1 insertions, 40 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 4cd1d0fd2542..fe876a77031a 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -81,8 +81,6 @@ struct cgroup_subsys_state {
81/* bits in struct cgroup_subsys_state flags field */ 81/* bits in struct cgroup_subsys_state flags field */
82enum { 82enum {
83 CSS_ROOT, /* This CSS is the root of the subsystem */ 83 CSS_ROOT, /* This CSS is the root of the subsystem */
84 CSS_REMOVED, /* This CSS is dead */
85 CSS_CLEAR_CSS_REFS, /* @ss->__DEPRECATED_clear_css_refs */
86}; 84};
87 85
88/* Caller must verify that the css is not for root cgroup */ 86/* Caller must verify that the css is not for root cgroup */
@@ -105,11 +103,6 @@ static inline void css_get(struct cgroup_subsys_state *css)
105 __css_get(css, 1); 103 __css_get(css, 1);
106} 104}
107 105
108static inline bool css_is_removed(struct cgroup_subsys_state *css)
109{
110 return test_bit(CSS_REMOVED, &css->flags);
111}
112
113/* 106/*
114 * Call css_tryget() to take a reference on a css if your existing 107 * Call css_tryget() to take a reference on a css if your existing
115 * (known-valid) reference isn't already ref-counted. Returns false if 108 * (known-valid) reference isn't already ref-counted. Returns false if
@@ -148,10 +141,6 @@ enum {
148 /* Control Group requires release notifications to userspace */ 141 /* Control Group requires release notifications to userspace */
149 CGRP_NOTIFY_ON_RELEASE, 142 CGRP_NOTIFY_ON_RELEASE,
150 /* 143 /*
151 * A thread in rmdir() is wating for this cgroup.
152 */
153 CGRP_WAIT_ON_RMDIR,
154 /*
155 * Clone cgroup values when creating a new child cgroup 144 * Clone cgroup values when creating a new child cgroup
156 */ 145 */
157 CGRP_CLONE_CHILDREN, 146 CGRP_CLONE_CHILDREN,
@@ -421,23 +410,6 @@ int cgroup_task_count(const struct cgroup *cgrp);
421int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); 410int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
422 411
423/* 412/*
424 * When the subsys has to access css and may add permanent refcnt to css,
425 * it should take care of racy conditions with rmdir(). Following set of
426 * functions, is for stop/restart rmdir if necessary.
427 * Because these will call css_get/put, "css" should be alive css.
428 *
429 * cgroup_exclude_rmdir();
430 * ...do some jobs which may access arbitrary empty cgroup
431 * cgroup_release_and_wakeup_rmdir();
432 *
433 * When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
434 * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
435 */
436
437void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
438void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
439
440/*
441 * Control Group taskset, used to pass around set of tasks to cgroup_subsys 413 * Control Group taskset, used to pass around set of tasks to cgroup_subsys
442 * methods. 414 * methods.
443 */ 415 */
@@ -466,7 +438,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
466 438
467struct cgroup_subsys { 439struct cgroup_subsys {
468 struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); 440 struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
469 int (*pre_destroy)(struct cgroup *cgrp); 441 void (*pre_destroy)(struct cgroup *cgrp);
470 void (*destroy)(struct cgroup *cgrp); 442 void (*destroy)(struct cgroup *cgrp);
471 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 443 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
472 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 444 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
@@ -488,17 +460,6 @@ struct cgroup_subsys {
488 bool use_id; 460 bool use_id;
489 461
490 /* 462 /*
491 * If %true, cgroup removal will try to clear css refs by retrying
492 * ss->pre_destroy() until there's no css ref left. This behavior
493 * is strictly for backward compatibility and will be removed as
494 * soon as the current user (memcg) is updated.
495 *
496 * If %false, ss->pre_destroy() can't fail and cgroup removal won't
497 * wait for css refs to drop to zero before proceeding.
498 */
499 bool __DEPRECATED_clear_css_refs;
500
501 /*
502 * If %false, this subsystem is properly hierarchical - 463 * If %false, this subsystem is properly hierarchical -
503 * configuration, resource accounting and restriction on a parent 464 * configuration, resource accounting and restriction on a parent
504 * cgroup cover those of its children. If %true, hierarchy support 465 * cgroup cover those of its children. If %true, hierarchy support