--- kernel/cgroup.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -779,6 +779,22 @@ static inline void get_css_set(struct cs atomic_inc(&cset->refcount); } +static void dump_cset(struct css_set *cset) +{ + struct cgrp_cset_link *link; + + printk("XXX dumping cset %p\n", cset); + list_for_each_entry(link, &cset->cgrp_links, cgrp_link) { + struct cgroup *cgrp = link->cgrp; + struct cgroup_root *root = cgrp->root; + + printk("root %d:0x%04x:%s ", + root->hierarchy_id, root->subsys_mask, root->name); + pr_cont_cgroup_path(cgrp); + pr_cont("\n"); + } +} + /** * compare_css_sets - helper function for find_existing_css_set(). * @cset: candidate css_set being tested @@ -831,7 +847,10 @@ static bool compare_css_sets(struct css_ cgrp1 = link1->cgrp; cgrp2 = link2->cgrp; /* Hierarchies should be linked in the same order. */ - BUG_ON(cgrp1->root != cgrp2->root); + if (WARN_ON(cgrp1->root != cgrp2->root)) { + dump_cset(cset); + dump_cset(old_cset); + } /* * If this hierarchy is the hierarchy of the cgroup