Skip to content

Commit 1db1e31

Browse files
committed
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. 8c7f6ed ("cgroup: mark subsystems with broken hierarchy support and whine if cgroups are nested for them") ed95779 ("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 <[email protected]>
2 parents 5d8f72b + bcf6de1 commit 1db1e31

5 files changed

Lines changed: 156 additions & 336 deletions

File tree

block/blk-cgroup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ struct cftype blkcg_files[] = {
600600
*
601601
* This is the blkcg counterpart of ioc_release_fn().
602602
*/
603-
static int blkcg_pre_destroy(struct cgroup *cgroup)
603+
static void blkcg_pre_destroy(struct cgroup *cgroup)
604604
{
605605
struct blkcg *blkcg = cgroup_to_blkcg(cgroup);
606606

@@ -622,7 +622,6 @@ static int blkcg_pre_destroy(struct cgroup *cgroup)
622622
}
623623

624624
spin_unlock_irq(&blkcg->lock);
625-
return 0;
626625
}
627626

628627
static void blkcg_destroy(struct cgroup *cgroup)

include/linux/cgroup.h

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ struct cgroup_subsys_state {
8181
/* bits in struct cgroup_subsys_state flags field */
8282
enum {
8383
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 */
8684
};
8785

8886
/* 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)
105103
__css_get(css, 1);
106104
}
107105

108-
static inline bool css_is_removed(struct cgroup_subsys_state *css)
109-
{
110-
return test_bit(CSS_REMOVED, &css->flags);
111-
}
112-
113106
/*
114107
* Call css_tryget() to take a reference on a css if your existing
115108
* (known-valid) reference isn't already ref-counted. Returns false if
@@ -147,10 +140,6 @@ enum {
147140
CGRP_RELEASABLE,
148141
/* Control Group requires release notifications to userspace */
149142
CGRP_NOTIFY_ON_RELEASE,
150-
/*
151-
* A thread in rmdir() is wating for this cgroup.
152-
*/
153-
CGRP_WAIT_ON_RMDIR,
154143
/*
155144
* Clone cgroup values when creating a new child cgroup
156145
*/
@@ -420,23 +409,6 @@ int cgroup_task_count(const struct cgroup *cgrp);
420409
/* Return true if cgrp is a descendant of the task's cgroup */
421410
int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
422411

423-
/*
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-
437-
void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
438-
void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
439-
440412
/*
441413
* Control Group taskset, used to pass around set of tasks to cgroup_subsys
442414
* methods.
@@ -466,7 +438,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
466438

467439
struct cgroup_subsys {
468440
struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
469-
int (*pre_destroy)(struct cgroup *cgrp);
441+
void (*pre_destroy)(struct cgroup *cgrp);
470442
void (*destroy)(struct cgroup *cgrp);
471443
int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
472444
void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
@@ -487,17 +459,6 @@ struct cgroup_subsys {
487459
*/
488460
bool use_id;
489461

490-
/*
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-
501462
/*
502463
* If %false, this subsystem is properly hierarchical -
503464
* configuration, resource accounting and restriction on a parent

0 commit comments

Comments
 (0)