Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1340061 > unrolled thread
| Started by | Tejun Heo <tj@kernel.org> |
|---|---|
| First post | 2016-02-23 00:10 +0100 |
| Last post | 2016-02-23 05:00 +0100 |
| Articles | 8 — 3 participants |
Back to article view | Back to linux.kernel
[PATCHSET] cgroup: misc fixes and cleanups Tejun Heo <tj@kernel.org> - 2016-02-23 00:10 +0100
[PATCH 1/6] cgroup: fix error return value of cgroup_addrm_files() Tejun Heo <tj@kernel.org> - 2016-02-23 00:10 +0100
[PATCH 2/6] Revert "cgroup: add cgroup_subsys->css_e_css_changed()" Tejun Heo <tj@kernel.org> - 2016-02-23 00:10 +0100
[PATCH 4/6] cgroup: convert for_each_subsys_which() to do-while style Tejun Heo <tj@kernel.org> - 2016-02-23 00:10 +0100
[PATCH 3/6] cgroup: s/child_subsys_mask/subtree_ss_mask/ Tejun Heo <tj@kernel.org> - 2016-02-23 00:10 +0100
Re: [PATCHSET] cgroup: misc fixes and cleanups Johannes Weiner <hannes@cmpxchg.org> - 2016-02-23 02:40 +0100
Re: [PATCHSET] cgroup: misc fixes and cleanups Tejun Heo <tj@kernel.org> - 2016-02-23 04:30 +0100
Re: [PATCHSET] cgroup: misc fixes and cleanups Zefan Li <lizefan@huawei.com> - 2016-02-23 05:00 +0100
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 00:10 +0100 |
| Subject | [PATCHSET] cgroup: misc fixes and cleanups |
| Message-ID | <r57M5-4Su-3@gated-at.bofh.it> |
Hello,
This patchset contains the following six patches. The first one is a
fix but should be safe to route through for-4.6. The rest are misc
cleanups and improvements which don't cause notable behavior changes.
0001-cgroup-fix-error-return-value-of-cgroup_addrm_files.patch
0002-Revert-cgroup-add-cgroup_subsys-css_e_css_changed.patch
0003-cgroup-s-child_subsys_mask-subtree_ss_mask.patch
0004-cgroup-convert-for_each_subsys_which-to-do-while-sty.patch
0005-cgroup-use-do_each_subsys_mask-where-applicable.patch
0006-cgroup-make-cgroup-subsystem-masks-u16.patch
The patchset based on top of cgroup/for-4.6 223ffb29f972 ("cgroup:
provide cgroup_nov1= to disable controllers in v1 mounts") and is
available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-misc
diffstat follows. I'll pull in the branch into cgroup/for-4.6
soonish.
include/linux/cgroup-defs.h | 12 +-
kernel/cgroup.c | 217 +++++++++++++++++++-------------------------
2 files changed, 102 insertions(+), 127 deletions(-)
Thanks.
--
tejun
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 00:10 +0100 |
| Subject | [PATCH 1/6] cgroup: fix error return value of cgroup_addrm_files() |
| Message-ID | <r57M6-4Su-13@gated-at.bofh.it> |
| In reply to | #1340061 |
cgroup_addrm_files() incorrectly returned 0 after add failure. Fix
it.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/cgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7ad6191..68b032d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3369,7 +3369,7 @@ static int cgroup_addrm_files(struct cgroup_subsys_state *css,
bool is_add)
{
struct cftype *cft, *cft_end = NULL;
- int ret;
+ int ret = 0;
lockdep_assert_held(&cgroup_mutex);
@@ -3398,7 +3398,7 @@ static int cgroup_addrm_files(struct cgroup_subsys_state *css,
cgroup_rm_file(cgrp, cft);
}
}
- return 0;
+ return ret;
}
static int cgroup_apply_cftypes(struct cftype *cfts, bool is_add)
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 00:10 +0100 |
| Subject | [PATCH 2/6] Revert "cgroup: add cgroup_subsys->css_e_css_changed()" |
| Message-ID | <r57M6-4Su-23@gated-at.bofh.it> |
| In reply to | #1340061 |
This reverts commit 56c807ba4e91f0980567b6a69de239677879b17f.
cgroup_subsys->css_e_css_changed() was supposed to be used by cgroup
writeback support; however, the change to per-inode cgroup association
made it unnecessary and the callback doesn't have any user. Remove
it.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
include/linux/cgroup-defs.h | 1 -
kernel/cgroup.c | 18 ------------------
2 files changed, 19 deletions(-)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 789471d..4f3c0da 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -434,7 +434,6 @@ struct cgroup_subsys {
void (*css_released)(struct cgroup_subsys_state *css);
void (*css_free)(struct cgroup_subsys_state *css);
void (*css_reset)(struct cgroup_subsys_state *css);
- void (*css_e_css_changed)(struct cgroup_subsys_state *css);
int (*can_attach)(struct cgroup_taskset *tset);
void (*cancel_attach)(struct cgroup_taskset *tset);
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 68b032d..7727b6e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3127,24 +3127,6 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
}
}
- /*
- * The effective csses of all the descendants (excluding @cgrp) may
- * have changed. Subsystems can optionally subscribe to this event
- * by implementing ->css_e_css_changed() which is invoked if any of
- * the effective csses seen from the css's cgroup may have changed.
- */
- for_each_subsys(ss, ssid) {
- struct cgroup_subsys_state *this_css = cgroup_css(cgrp, ss);
- struct cgroup_subsys_state *css;
-
- if (!ss->css_e_css_changed || !this_css)
- continue;
-
- css_for_each_descendant_pre(css, this_css)
- if (css != this_css)
- ss->css_e_css_changed(css);
- }
-
kernfs_activate(cgrp->kn);
ret = 0;
out_unlock:
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 00:10 +0100 |
| Subject | [PATCH 4/6] cgroup: convert for_each_subsys_which() to do-while style |
| Message-ID | <r57M6-4Su-31@gated-at.bofh.it> |
| In reply to | #1340061 |
for_each_subsys_which() allows iterating subsystems specified in a
subsystem bitmask; unfortunately, it requires the mask to be an
unsigned long l-value which can be inconvenient and makes it awkward
to use a smaller type for subsystem masks.
This patch converts for_each_subsy_which() to do-while style which
allows it to drop the l-value requirement. The new iterator is named
do_each_subsys_mask() / while_each_subsys_mask().
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Aleksa Sarai <cyphar@cyphar.com>
---
kernel/cgroup.c | 72 ++++++++++++++++++++++++++++++++-------------------------
1 file changed, 40 insertions(+), 32 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f3cd67b..5d10298 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -514,22 +514,28 @@ static int notify_on_release(const struct cgroup *cgrp)
(((ss) = cgroup_subsys[ssid]) || true); (ssid)++)
/**
- * for_each_subsys_which - filter for_each_subsys with a bitmask
+ * do_each_subsys_mask - filter for_each_subsys with a bitmask
* @ss: the iteration cursor
* @ssid: the index of @ss, CGROUP_SUBSYS_COUNT after reaching the end
- * @ss_maskp: a pointer to the bitmask
+ * @ss_mask: the bitmask
*
* The block will only run for cases where the ssid-th bit (1 << ssid) of
- * mask is set to 1.
+ * @ss_mask is set.
*/
-#define for_each_subsys_which(ss, ssid, ss_maskp) \
- if (!CGROUP_SUBSYS_COUNT) /* to avoid spurious gcc warning */ \
+#define do_each_subsys_mask(ss, ssid, ss_mask) do { \
+ unsigned long __ss_mask = (ss_mask); \
+ if (!CGROUP_SUBSYS_COUNT) { /* to avoid spurious gcc warning */ \
(ssid) = 0; \
- else \
- for_each_set_bit(ssid, ss_maskp, CGROUP_SUBSYS_COUNT) \
- if (((ss) = cgroup_subsys[ssid]) && false) \
- break; \
- else
+ break; \
+ } \
+ for_each_set_bit(ssid, &__ss_mask, CGROUP_SUBSYS_COUNT) { \
+ (ss) = cgroup_subsys[ssid]; \
+ {
+
+#define while_each_subsys_mask() \
+ } \
+ } \
+} while (false)
/* iterate across the hierarchies */
#define for_each_root(root) \
@@ -1284,8 +1290,9 @@ static unsigned long cgroup_calc_subtree_ss_mask(struct cgroup *cgrp,
while (true) {
unsigned long new_ss_mask = cur_ss_mask;
- for_each_subsys_which(ss, ssid, &cur_ss_mask)
+ do_each_subsys_mask(ss, ssid, cur_ss_mask) {
new_ss_mask |= ss->depends_on;
+ } while_each_subsys_mask();
/*
* Mask out subsystems which aren't available. This can
@@ -1469,7 +1476,7 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
lockdep_assert_held(&cgroup_mutex);
- for_each_subsys_which(ss, ssid, &ss_mask) {
+ do_each_subsys_mask(ss, ssid, ss_mask) {
/* if @ss has non-root csses attached to it, can't move */
if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)))
return -EBUSY;
@@ -1477,14 +1484,14 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
/* can't move between two non-dummy roots either */
if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root)
return -EBUSY;
- }
+ } while_each_subsys_mask();
/* skip creating root files on dfl_root for inhibited subsystems */
tmp_ss_mask = ss_mask;
if (dst_root == &cgrp_dfl_root)
tmp_ss_mask &= ~cgrp_dfl_root_inhibit_ss_mask;
- for_each_subsys_which(ss, ssid, &tmp_ss_mask) {
+ do_each_subsys_mask(ss, ssid, tmp_ss_mask) {
struct cgroup *scgrp = &ss->root->cgrp;
int tssid;
@@ -1507,19 +1514,19 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
continue;
}
- for_each_subsys_which(ss, tssid, &tmp_ss_mask) {
+ do_each_subsys_mask(ss, tssid, tmp_ss_mask) {
if (tssid == ssid)
break;
css_clear_dir(cgroup_css(scgrp, ss), dcgrp);
- }
+ } while_each_subsys_mask();
return ret;
- }
+ } while_each_subsys_mask();
/*
* Nothing can fail from this point on. Remove files for the
* removed subsystems and rebind each subsystem.
*/
- for_each_subsys_which(ss, ssid, &ss_mask) {
+ do_each_subsys_mask(ss, ssid, ss_mask) {
struct cgroup_root *src_root = ss->root;
struct cgroup *scgrp = &src_root->cgrp;
struct cgroup_subsys_state *css = cgroup_css(scgrp, ss);
@@ -1556,7 +1563,7 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
if (ss->bind)
ss->bind(css);
- }
+ } while_each_subsys_mask();
kernfs_activate(dcgrp->kn);
return 0;
@@ -2838,12 +2845,12 @@ static void cgroup_print_ss_mask(struct seq_file *seq, unsigned long ss_mask)
bool printed = false;
int ssid;
- for_each_subsys_which(ss, ssid, &ss_mask) {
+ do_each_subsys_mask(ss, ssid, ss_mask) {
if (printed)
seq_putc(seq, ' ');
seq_printf(seq, "%s", ss->name);
printed = true;
- }
+ } while_each_subsys_mask();
if (printed)
seq_putc(seq, '\n');
}
@@ -2956,11 +2963,9 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
*/
buf = strstrip(buf);
while ((tok = strsep(&buf, " "))) {
- unsigned long tmp_ss_mask = ~cgrp_dfl_root_inhibit_ss_mask;
-
if (tok[0] == '\0')
continue;
- for_each_subsys_which(ss, ssid, &tmp_ss_mask) {
+ do_each_subsys_mask(ss, ssid, ~cgrp_dfl_root_inhibit_ss_mask) {
if (!cgroup_ssid_enabled(ssid) ||
strcmp(tok + 1, ss->name))
continue;
@@ -2975,7 +2980,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
return -EINVAL;
}
break;
- }
+ } while_each_subsys_mask();
if (ssid == CGROUP_SUBSYS_COUNT)
return -EINVAL;
}
@@ -3049,7 +3054,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
* still around. In such cases, wait till it's gone using
* offline_waitq.
*/
- for_each_subsys_which(ss, ssid, &css_enable) {
+ do_each_subsys_mask(ss, ssid, css_enable) {
cgroup_for_each_live_child(child, cgrp) {
DEFINE_WAIT(wait);
@@ -3066,7 +3071,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
return restart_syscall();
}
- }
+ } while_each_subsys_mask();
cgrp->subtree_control = new_sc;
cgrp->subtree_ss_mask = new_ss;
@@ -5509,11 +5514,11 @@ int cgroup_can_fork(struct task_struct *child)
struct cgroup_subsys *ss;
int i, j, ret;
- for_each_subsys_which(ss, i, &have_canfork_callback) {
+ do_each_subsys_mask(ss, i, have_canfork_callback) {
ret = ss->can_fork(child);
if (ret)
goto out_revert;
- }
+ } while_each_subsys_mask();
return 0;
@@ -5598,8 +5603,9 @@ void cgroup_post_fork(struct task_struct *child)
* css_set; otherwise, @child might change state between ->fork()
* and addition to css_set.
*/
- for_each_subsys_which(ss, i, &have_fork_callback)
+ do_each_subsys_mask(ss, i, have_fork_callback) {
ss->fork(child);
+ } while_each_subsys_mask();
}
/**
@@ -5642,8 +5648,9 @@ void cgroup_exit(struct task_struct *tsk)
}
/* see cgroup_post_fork() for details */
- for_each_subsys_which(ss, i, &have_exit_callback)
+ do_each_subsys_mask(ss, i, have_exit_callback) {
ss->exit(tsk);
+ } while_each_subsys_mask();
}
void cgroup_free(struct task_struct *task)
@@ -5652,8 +5659,9 @@ void cgroup_free(struct task_struct *task)
struct cgroup_subsys *ss;
int ssid;
- for_each_subsys_which(ss, ssid, &have_free_callback)
+ do_each_subsys_mask(ss, ssid, have_free_callback) {
ss->free(task);
+ } while_each_subsys_mask();
put_css_set(cset);
}
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 00:10 +0100 |
| Subject | [PATCH 3/6] cgroup: s/child_subsys_mask/subtree_ss_mask/ |
| Message-ID | <r57M6-4Su-25@gated-at.bofh.it> |
| In reply to | #1340061 |
For consistency with cgroup->subtree_control.
* cgroup->child_subsys_mask -> cgroup->subtree_ss_mask
* cgroup_calc_child_subsys_mask() -> cgroup_calc_subtree_ss_mask()
* cgroup_refresh_child_subsys_mask() -> cgroup_refresh_subtree_ss_mask()
No functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
include/linux/cgroup-defs.h | 11 +++++------
kernel/cgroup.c | 48 ++++++++++++++++++++++-----------------------
2 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 4f3c0da..c68ae7f 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -253,13 +253,12 @@ struct cgroup {
/*
* The bitmask of subsystems enabled on the child cgroups.
* ->subtree_control is the one configured through
- * "cgroup.subtree_control" while ->child_subsys_mask is the
- * effective one which may have more subsystems enabled.
- * Controller knobs are made available iff it's enabled in
- * ->subtree_control.
+ * "cgroup.subtree_control" while ->child_ss_mask is the effective
+ * one which may have more subsystems enabled. Controller knobs
+ * are made available iff it's enabled in ->subtree_control.
*/
- unsigned int subtree_control;
- unsigned int child_subsys_mask;
+ unsigned long subtree_control;
+ unsigned long subtree_ss_mask;
/* Private pointers for each registered subsystem */
struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT];
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7727b6e..f3cd67b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -391,10 +391,10 @@ static struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
/*
* This function is used while updating css associations and thus
- * can't test the csses directly. Use ->child_subsys_mask.
+ * can't test the csses directly. Use ->subtree_ss_mask.
*/
while (cgroup_parent(cgrp) &&
- !(cgroup_parent(cgrp)->child_subsys_mask & (1 << ss->id)))
+ !(cgroup_parent(cgrp)->subtree_ss_mask & (1 << ss->id)))
cgrp = cgroup_parent(cgrp);
return cgroup_css(cgrp, ss);
@@ -1256,7 +1256,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft)
}
/**
- * cgroup_calc_child_subsys_mask - calculate child_subsys_mask
+ * cgroup_calc_subtree_ss_mask - calculate subtree_ss_mask
* @cgrp: the target cgroup
* @subtree_control: the new subtree_control mask to consider
*
@@ -1268,8 +1268,8 @@ static umode_t cgroup_file_mode(const struct cftype *cft)
* @subtree_control is to be applied to @cgrp. The returned mask is always
* a superset of @subtree_control and follows the usual hierarchy rules.
*/
-static unsigned long cgroup_calc_child_subsys_mask(struct cgroup *cgrp,
- unsigned long subtree_control)
+static unsigned long cgroup_calc_subtree_ss_mask(struct cgroup *cgrp,
+ unsigned long subtree_control)
{
struct cgroup *parent = cgroup_parent(cgrp);
unsigned long cur_ss_mask = subtree_control;
@@ -1293,7 +1293,7 @@ static unsigned long cgroup_calc_child_subsys_mask(struct cgroup *cgrp,
* to non-default hierarchies.
*/
if (parent)
- new_ss_mask &= parent->child_subsys_mask;
+ new_ss_mask &= parent->subtree_ss_mask;
else
new_ss_mask &= cgrp->root->subsys_mask;
@@ -1306,16 +1306,16 @@ static unsigned long cgroup_calc_child_subsys_mask(struct cgroup *cgrp,
}
/**
- * cgroup_refresh_child_subsys_mask - update child_subsys_mask
+ * cgroup_refresh_subtree_ss_mask - update subtree_ss_mask
* @cgrp: the target cgroup
*
- * Update @cgrp->child_subsys_mask according to the current
- * @cgrp->subtree_control using cgroup_calc_child_subsys_mask().
+ * Update @cgrp->subtree_ss_mask according to the current
+ * @cgrp->subtree_control using cgroup_calc_subtree_ss_mask().
*/
-static void cgroup_refresh_child_subsys_mask(struct cgroup *cgrp)
+static void cgroup_refresh_subtree_ss_mask(struct cgroup *cgrp)
{
- cgrp->child_subsys_mask =
- cgroup_calc_child_subsys_mask(cgrp, cgrp->subtree_control);
+ cgrp->subtree_ss_mask =
+ cgroup_calc_subtree_ss_mask(cgrp, cgrp->subtree_control);
}
/**
@@ -1542,7 +1542,7 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
src_root->subsys_mask &= ~(1 << ssid);
scgrp->subtree_control &= ~(1 << ssid);
- cgroup_refresh_child_subsys_mask(scgrp);
+ cgroup_refresh_subtree_ss_mask(scgrp);
/* default hierarchy doesn't enable controllers by default */
dst_root->subsys_mask |= 1 << ssid;
@@ -1550,7 +1550,7 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
static_branch_enable(cgroup_subsys_on_dfl_key[ssid]);
} else {
dcgrp->subtree_control |= 1 << ssid;
- cgroup_refresh_child_subsys_mask(dcgrp);
+ cgroup_refresh_subtree_ss_mask(dcgrp);
static_branch_disable(cgroup_subsys_on_dfl_key[ssid]);
}
@@ -2523,11 +2523,11 @@ static int cgroup_migrate_prepare_dst(struct cgroup *dst_cgrp,
lockdep_assert_held(&cgroup_mutex);
/*
- * Except for the root, child_subsys_mask must be zero for a cgroup
+ * Except for the root, subtree_ss_mask must be zero for a cgroup
* with tasks so that child cgroups don't compete against tasks.
*/
if (dst_cgrp && cgroup_on_dfl(dst_cgrp) && cgroup_parent(dst_cgrp) &&
- dst_cgrp->child_subsys_mask)
+ dst_cgrp->subtree_ss_mask)
return -EBUSY;
/* look up the dst cset for each src cset and link it to src */
@@ -2880,7 +2880,7 @@ static int cgroup_subtree_control_show(struct seq_file *seq, void *v)
* cgroup_update_dfl_csses - update css assoc of a subtree in default hierarchy
* @cgrp: root of the subtree to update csses for
*
- * @cgrp's child_subsys_mask has changed and its subtree's (self excluded)
+ * @cgrp's subtree_ss_mask has changed and its subtree's (self excluded)
* css associations need to be updated accordingly. This function looks up
* all css_sets which are attached to the subtree, creates the matching
* updated css_sets and migrates the tasks to the new ones.
@@ -2902,7 +2902,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp)
css_for_each_descendant_pre(css, cgroup_css(cgrp, NULL)) {
struct cgrp_cset_link *link;
- /* self is not affected by child_subsys_mask change */
+ /* self is not affected by subtree_ss_mask change */
if (css->cgroup == cgrp)
continue;
@@ -3034,9 +3034,9 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
* depending on subsystem dependencies.
*/
old_sc = cgrp->subtree_control;
- old_ss = cgrp->child_subsys_mask;
+ old_ss = cgrp->subtree_ss_mask;
new_sc = (old_sc | enable) & ~disable;
- new_ss = cgroup_calc_child_subsys_mask(cgrp, new_sc);
+ new_ss = cgroup_calc_subtree_ss_mask(cgrp, new_sc);
css_enable = ~old_ss & new_ss;
css_disable = old_ss & ~new_ss;
@@ -3069,7 +3069,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
}
cgrp->subtree_control = new_sc;
- cgrp->child_subsys_mask = new_ss;
+ cgrp->subtree_ss_mask = new_ss;
/*
* Create new csses or make the existing ones visible. A css is
@@ -3135,7 +3135,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
err_undo_css:
cgrp->subtree_control = old_sc;
- cgrp->child_subsys_mask = old_ss;
+ cgrp->subtree_ss_mask = old_ss;
for_each_subsys(ss, ssid) {
if (!(enable & (1 << ssid)))
@@ -4969,7 +4969,7 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
/* let's create and online css's */
for_each_subsys(ss, ssid) {
- if (parent->child_subsys_mask & (1 << ssid)) {
+ if (parent->subtree_ss_mask & (1 << ssid)) {
ret = create_css(cgrp, ss,
parent->subtree_control & (1 << ssid));
if (ret)
@@ -4983,7 +4983,7 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
*/
if (!cgroup_on_dfl(cgrp)) {
cgrp->subtree_control = parent->subtree_control;
- cgroup_refresh_child_subsys_mask(cgrp);
+ cgroup_refresh_subtree_ss_mask(cgrp);
}
kernfs_activate(kn);
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Johannes Weiner <hannes@cmpxchg.org> |
|---|---|
| Date | 2016-02-23 02:40 +0100 |
| Message-ID | <r5a7i-6wg-37@gated-at.bofh.it> |
| In reply to | #1340061 |
On Mon, Feb 22, 2016 at 06:05:43PM -0500, Tejun Heo wrote: > This patchset contains the following six patches. The first one is a > fix but should be safe to route through for-4.6. The rest are misc > cleanups and improvements which don't cause notable behavior changes. These look good to me. Acked-by: Johannes Weiner <hannes@cmpxchg.org>
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-02-23 04:30 +0100 |
| Message-ID | <r5bPI-7KL-9@gated-at.bofh.it> |
| In reply to | #1340061 |
On Mon, Feb 22, 2016 at 06:05:43PM -0500, Tejun Heo wrote: > 0001-cgroup-fix-error-return-value-of-cgroup_addrm_files.patch > 0002-Revert-cgroup-add-cgroup_subsys-css_e_css_changed.patch > 0003-cgroup-s-child_subsys_mask-subtree_ss_mask.patch > 0004-cgroup-convert-for_each_subsys_which-to-do-while-sty.patch > 0005-cgroup-use-do_each_subsys_mask-where-applicable.patch > 0006-cgroup-make-cgroup-subsystem-masks-u16.patch Applied 1-6 to cgroup/for-4.6. -- tejun
[toc] | [prev] | [next] | [standalone]
| From | Zefan Li <lizefan@huawei.com> |
|---|---|
| Date | 2016-02-23 05:00 +0100 |
| Message-ID | <r5ciL-7X0-11@gated-at.bofh.it> |
| In reply to | #1340061 |
On 2016/2/23 7:05, Tejun Heo wrote:
> Hello,
>
> This patchset contains the following six patches. The first one is a
> fix but should be safe to route through for-4.6. The rest are misc
> cleanups and improvements which don't cause notable behavior changes.
>
> 0001-cgroup-fix-error-return-value-of-cgroup_addrm_files.patch
> 0002-Revert-cgroup-add-cgroup_subsys-css_e_css_changed.patch
> 0003-cgroup-s-child_subsys_mask-subtree_ss_mask.patch
> 0004-cgroup-convert-for_each_subsys_which-to-do-while-sty.patch
> 0005-cgroup-use-do_each_subsys_mask-where-applicable.patch
> 0006-cgroup-make-cgroup-subsystem-masks-u16.patch
>
> The patchset based on top of cgroup/for-4.6 223ffb29f972 ("cgroup:
> provide cgroup_nov1= to disable controllers in v1 mounts") and is
> available in the following git branch.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-misc
>
> diffstat follows. I'll pull in the branch into cgroup/for-4.6
> soonish.
>
> include/linux/cgroup-defs.h | 12 +-
> kernel/cgroup.c | 217 +++++++++++++++++++-------------------------
> 2 files changed, 102 insertions(+), 127 deletions(-)
>
Acked-by: Zefan Li <lizefan@huawei.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web