Hello, Alex.

On Tue, Dec 22, 2015 at 07:06:41PM +0000, Alex Ng (LIS) wrote:
> > Can you please let me know the steps to reproduce the bug?
> 
> I tried this on a Hyper-V VM hosted in Windows Server 2012R2 and ran
> the attached script.  The script clones the linux-next tree in a
> random directory under /tmp in a tight loop.
>
> This panic is not always reproducible, and I have only hit it once
> after running the script about 10 times. A different kernel panic
> happens each time I run this script; and the panics always happen
> during the first iteration of the loop.

Heh, I don't get it.  The script doesn't do anything cgroup specific.
Can you please apply the attached patch, reproduce the issue and
report the kernel log?

Thanks.

-- 
tejun
---
 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

Reply via email to