From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"menage@google.com" <menage@google.com>
Subject: Re: [RFC][PATCH 1/4] cgroup: support per cgroup subsys state ID (CSS ID)
Date: Fri, 9 Jan 2009 13:24:04 +0900 [thread overview]
Message-ID: <20090109132404.6ece68e6.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <4966CB89.1020403@cn.fujitsu.com>
On Fri, 09 Jan 2009 11:59:05 +0800
Li Zefan <lizf@cn.fujitsu.com> wrote:
> > static struct inode *cgroup_new_inode(mode_t mode, struct super_block *sb)
> > {
> > struct inode *inode = new_inode(sb);
> > @@ -2335,6 +2339,7 @@ static void init_cgroup_css(struct cgrou
> > css->cgroup = cgrp;
> > atomic_set(&css->refcnt, 1);
> > css->flags = 0;
> > + css->id = NULL;
> > if (cgrp == dummytop)
> > set_bit(CSS_ROOT, &css->flags);
> > BUG_ON(cgrp->subsys[ss->subsys_id]);
> > @@ -2410,6 +2415,10 @@ static long cgroup_create(struct cgroup
> > goto err_destroy;
> > }
> > init_cgroup_css(css, ss, cgrp);
> > + if (ss->use_id)
> > + if (alloc_css_id(ss, parent, cgrp))
> > + goto err_destroy;
> > + /* At error, ->destroy() callback has to free assigned ID. */
>
> A bug here:
>
> if alloc_css_id(ss, parent, cgrp) failed, then ss->destroy() called free_css_id(),
> then panic.
>
> maybe check if (css->id == NULL) in free_css_id() ?
>
Oh, thanks. it will be necessary.
I'll fix it.
But..Hmm...maybe it's useful to add fault injection feature to debug cgroup
for this kind of loop operation.
-Kame
> > }
> >
> > cgroup_lock_hierarchy(root);
> > @@ -2699,6 +2708,8 @@ int __init cgroup_init(void)
> > struct cgroup_subsys *ss = subsys[i];
> > if (!ss->early_init)
> > cgroup_init_subsys(ss);
> > + if (ss->use_id)
> > + cgroup_subsys_init_idr(ss);
> > }
> >
> > /* Add init_css_set to the hash table */
> > @@ -3231,3 +3242,260 @@ static int __init cgroup_disable(char *s
> > return 1;
> > }
> > __setup("cgroup_disable=", cgroup_disable);
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-01-09 4:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 9:25 [RFC][PATCH] cgroup and memcg updates 20090108 KAMEZAWA Hiroyuki
2009-01-08 9:28 ` [RFC][PATCH 1/4] cgroup: support per cgroup subsys state ID (CSS ID) KAMEZAWA Hiroyuki
2009-01-09 3:59 ` Li Zefan
2009-01-09 4:24 ` KAMEZAWA Hiroyuki [this message]
2009-01-10 0:23 ` Paul Menage
2009-01-10 0:49 ` KAMEZAWA Hiroyuki
2009-01-12 7:21 ` Balbir Singh
2009-01-15 6:12 ` KAMEZAWA Hiroyuki
2009-01-13 7:40 ` Li Zefan
2009-01-13 9:22 ` KAMEZAWA Hiroyuki
2009-01-08 9:30 ` [RFC][PATCH 2/4] memcg: use CSS ID in memcg KAMEZAWA Hiroyuki
2009-01-12 12:14 ` Balbir Singh
2009-01-15 6:19 ` KAMEZAWA Hiroyuki
2009-01-08 9:32 ` [RFC][PATCH 3/4] memcg: fix OOM KILL under hierarchy KAMEZAWA Hiroyuki
2009-01-13 8:33 ` Li Zefan
2009-01-13 9:25 ` KAMEZAWA Hiroyuki
2009-01-08 9:35 ` [RFC][PATCH 4/4] cgroup-memcg fix frequent EBUSY at rmdir KAMEZAWA Hiroyuki
2009-01-14 2:48 ` Paul Menage
2009-01-14 3:00 ` KAMEZAWA Hiroyuki
2009-01-14 3:05 ` Paul Menage
2009-01-14 3:12 ` KAMEZAWA Hiroyuki
2009-01-20 10:47 ` [RFC][PATCH 4/4] cgroup-memcg fix frequent EBUSY at rmdir v2 KAMEZAWA Hiroyuki
2009-01-21 10:00 ` Paul Menage
2009-01-21 10:32 ` KAMEZAWA Hiroyuki
2009-01-21 10:43 ` Paul Menage
2009-01-21 10:45 ` KAMEZAWA Hiroyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090109132404.6ece68e6.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=nishimura@mxp.nes.nec.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox