From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933591AbbLWQy2 (ORCPT ); Wed, 23 Dec 2015 11:54:28 -0500 Received: from mail-yk0-f175.google.com ([209.85.160.175]:33528 "EHLO mail-yk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbbLWQyZ (ORCPT ); Wed, 23 Dec 2015 11:54:25 -0500 Date: Wed, 23 Dec 2015 11:54:23 -0500 From: "tj@kernel.org" To: "Alex Ng (LIS)" Cc: "lizefan@huawei.com" , "hannes@cmpxchg.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [OOPS] BUG_ON in cgroups on 4.4.0-rc5-next Message-ID: <20151223165423.GJ5003@mtj.duckdns.org> References: <20151221215618.GB25997@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=dbg --- 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 --NzB8fVQJ5HfG6fxh--