Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-09 Thread Michal Hocko
On Mon 08-04-13 14:36:46, Tejun Heo wrote: > On Mon, Apr 08, 2013 at 08:03:44PM +0200, Michal Hocko wrote: > > __mem_cgroup_same_or_subtree relies on css_is_ancestor if hierarchy is > > enabled for ages. This, however, is not correct because use_hierarchy > > doesn't need to be true all the way up

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-09 Thread Michal Hocko
On Mon 08-04-13 14:36:46, Tejun Heo wrote: On Mon, Apr 08, 2013 at 08:03:44PM +0200, Michal Hocko wrote: __mem_cgroup_same_or_subtree relies on css_is_ancestor if hierarchy is enabled for ages. This, however, is not correct because use_hierarchy doesn't need to be true all the way up the

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
On 2013/4/9 11:21, Kamezawa Hiroyuki wrote: > (2013/04/08 17:20), Li Zefan wrote: >> This will be used as a replacement for css_is_ancestor(). >> >> Signed-off-by: Li Zefan > > Acked-by: KAMEZAWA Hiroyuki > > Hmmbut do we need "depth" ? > which was removed in Tejun's "[PATCHSET] perf,

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Kamezawa Hiroyuki
(2013/04/08 17:20), Li Zefan wrote: > This will be used as a replacement for css_is_ancestor(). > > Signed-off-by: Li Zefan Acked-by: KAMEZAWA Hiroyuki Hmmbut do we need "depth" ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
On Mon, Apr 08, 2013 at 08:03:44PM +0200, Michal Hocko wrote: > __mem_cgroup_same_or_subtree relies on css_is_ancestor if hierarchy is > enabled for ages. This, however, is not correct because use_hierarchy > doesn't need to be true all the way up the cgroup hierarchy. Consider > the following

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 16:47:50, Michal Hocko wrote: > On Mon 08-04-13 16:20:11, Li Zefan wrote: > [...] > > @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state > > *cgroup_css_from_dir(struct file *f, int id) > > return css ? css : ERR_PTR(-ENOENT); > > } > > > > +/** > > + * cgroup_is_ancestor -

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 08:57:26, Tejun Heo wrote: > Hello, > > On Mon, Apr 08, 2013 at 04:47:50PM +0200, Michal Hocko wrote: > > On Mon 08-04-13 16:20:11, Li Zefan wrote: > > [...] > > > @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state > > > *cgroup_css_from_dir(struct file *f, int id) > > > return

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
Hello, On Mon, Apr 08, 2013 at 04:47:50PM +0200, Michal Hocko wrote: > On Mon 08-04-13 16:20:11, Li Zefan wrote: > [...] > > @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state > > *cgroup_css_from_dir(struct file *f, int id) > > return css ? css : ERR_PTR(-ENOENT); > > } > > > > +/** > > +

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
Hello, Li. On Mon, Apr 08, 2013 at 04:20:11PM +0800, Li Zefan wrote: > +/** > + * cgroup_is_ancestor - test "root" cgroup is an ancestor of "child" > + * @child: the cgroup to be tested. > + * @root: the cgroup supposed to be an ancestor of the child. Please explain locking in the comment. (I

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 16:20:11, Li Zefan wrote: [...] > @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct > file *f, int id) > return css ? css : ERR_PTR(-ENOENT); > } > > +/** > + * cgroup_is_ancestor - test "root" cgroup is an ancestor of "child" > + * @child: the

[PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
This will be used as a replacement for css_is_ancestor(). Signed-off-by: Li Zefan --- include/linux/cgroup.h | 3 +++ kernel/cgroup.c| 21 + 2 files changed, 24 insertions(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 2eaedc1..96072e4 100644

[PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
This will be used as a replacement for css_is_ancestor(). Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 3 +++ kernel/cgroup.c| 21 + 2 files changed, 24 insertions(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 16:20:11, Li Zefan wrote: [...] @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id) return css ? css : ERR_PTR(-ENOENT); } +/** + * cgroup_is_ancestor - test root cgroup is an ancestor of child + * @child: the cgroup to

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
Hello, Li. On Mon, Apr 08, 2013 at 04:20:11PM +0800, Li Zefan wrote: +/** + * cgroup_is_ancestor - test root cgroup is an ancestor of child + * @child: the cgroup to be tested. + * @root: the cgroup supposed to be an ancestor of the child. Please explain locking in the comment. (I know it

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
Hello, On Mon, Apr 08, 2013 at 04:47:50PM +0200, Michal Hocko wrote: On Mon 08-04-13 16:20:11, Li Zefan wrote: [...] @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id) return css ? css : ERR_PTR(-ENOENT); } +/** + *

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 08:57:26, Tejun Heo wrote: Hello, On Mon, Apr 08, 2013 at 04:47:50PM +0200, Michal Hocko wrote: On Mon 08-04-13 16:20:11, Li Zefan wrote: [...] @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id) return css ? css :

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Michal Hocko
On Mon 08-04-13 16:47:50, Michal Hocko wrote: On Mon 08-04-13 16:20:11, Li Zefan wrote: [...] @@ -5299,6 +5300,26 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id) return css ? css : ERR_PTR(-ENOENT); } +/** + * cgroup_is_ancestor - test root cgroup

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Tejun Heo
On Mon, Apr 08, 2013 at 08:03:44PM +0200, Michal Hocko wrote: __mem_cgroup_same_or_subtree relies on css_is_ancestor if hierarchy is enabled for ages. This, however, is not correct because use_hierarchy doesn't need to be true all the way up the cgroup hierarchy. Consider the following

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Kamezawa Hiroyuki
(2013/04/08 17:20), Li Zefan wrote: This will be used as a replacement for css_is_ancestor(). Signed-off-by: Li Zefan lize...@huawei.com Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Hmmbut do we need depth ? -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
On 2013/4/9 11:21, Kamezawa Hiroyuki wrote: (2013/04/08 17:20), Li Zefan wrote: This will be used as a replacement for css_is_ancestor(). Signed-off-by: Li Zefan lize...@huawei.com Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Hmmbut do we need depth ? which was