cgroup: Skip subtree root in cgroup_update_dfl_csses()
Changes
1 files changed · +9 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/cgroup/cgroup.c | modified | +9 | −0 | View file |
kernel/cgroup/cgroup.c
View filediff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index c85dadf..85fa4c8 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2971,6 +2971,15 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp)
cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) {
struct cgrp_cset_link *link;
+ /*
+ * As cgroup_update_dfl_csses() is only called by
+ * cgroup_apply_control(). The csses associated with the
+ * given cgrp will not be affected by changes made to
+ * its subtree_control file. We can skip them.
+ */
+ if (dsct == cgrp)
+ continue;
+
list_for_each_entry(link, &dsct->cset_links, cset_link)
cgroup_migrate_add_src(link->cset, dsct, &mgctx);
}