* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <1275059781-9831-1-git-send-email-gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> @ 2010-05-28 22:25 ` Paul Menage 0 siblings, 0 replies; 8+ messages in thread From: Paul Menage @ 2010-05-28 22:25 UTC (permalink / raw) To: Greg Thelen Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Morton, Paul E. McKenney On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > > Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Good catch, thanks. Paul > --- > kernel/cgroup.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index 422cb19..3ac6f5b 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c > @@ -4598,7 +4598,7 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent, > parent_css = parent->subsys[subsys_id]; > child_css = child->subsys[subsys_id]; > parent_id = parent_css->id; > - depth = parent_id->depth; > + depth = parent_id->depth + 1; > > child_id = get_new_cssid(ss, depth); > if (IS_ERR(child_id)) > -- > 1.7.0.1 > > ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <AANLkTino0k-wok9kXLmWTyr40dZKSCnR0Uk41uxAj5k1@mail.gmail.com>]
[parent not found: <AANLkTino0k-wok9kXLmWTyr40dZKSCnR0Uk41uxAj5k1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <AANLkTino0k-wok9kXLmWTyr40dZKSCnR0Uk41uxAj5k1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2010-05-30 23:45 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 8+ messages in thread From: KAMEZAWA Hiroyuki @ 2010-05-30 23:45 UTC (permalink / raw) To: Paul Menage Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Morton, Paul E. McKenney On Fri, 28 May 2010 15:25:08 -0700 Paul Menage <menage@google.com> wrote: > On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen@google.com> wrote: > > > > Signed-off-by: Greg Thelen <gthelen@google.com> > > Acked-by: Paul Menage <menage@google.com> > > Good catch, thanks. > Nice Catch. Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> But, who breaks this ? Do we need backport this against old kernels ? 2.6.33 has this. > 3959 depth = css_depth(parent_css) + 1; > 3960 parent_id = parent_css->id; > 3961 > 3962 child_id = get_new_cssid(ss, depth); Thanks, -Kame > Paul > > > --- > > kernel/cgroup.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > > index 422cb19..3ac6f5b 100644 > > --- a/kernel/cgroup.c > > +++ b/kernel/cgroup.c > > @@ -4598,7 +4598,7 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent, > > parent_css = parent->subsys[subsys_id]; > > child_css = child->subsys[subsys_id]; > > parent_id = parent_css->id; > > - depth = parent_id->depth; > > + depth = parent_id->depth + 1; > > > > child_id = get_new_cssid(ss, depth); > > if (IS_ERR(child_id)) > > -- > > 1.7.0.1 > > > > > _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20100531084529.2b1f0d25.kamezawa.hiroyu@jp.fujitsu.com>]
[parent not found: <20100531085431.a45b30b9.kamezawa.hiroyu@jp.fujitsu.com>]
[parent not found: <20100531085431.a45b30b9.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <20100531085431.a45b30b9.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2010-05-31 0:44 ` Greg Thelen 0 siblings, 0 replies; 8+ messages in thread From: Greg Thelen @ 2010-05-31 0:44 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Menage, Paul E. McKenney, Andrew Morton On Sun, May 30, 2010 at 4:54 PM, KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > On Mon, 31 May 2010 08:45:29 +0900 > KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > >> On Fri, 28 May 2010 15:25:08 -0700 >> Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: >> >> > On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: >> > > >> > > Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >> > >> > Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >> > >> > Good catch, thanks. >> > >> Nice Catch. >> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> >> >> But, who breaks this ? Do we need backport this against old kernels ? >> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fae9c791703606636c1220e47f6690660042ce7f > > Hmm. this one. and 2.6.34 needs this patch. Greg, could you post this to > stable-2.6.34 tree ? Given that I forgot to include "Cc: stable <stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>" in the patch, I assume the best way to get this patch into -stable is for me to email the commit id to stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org once the patch is accepted into Linus' tree. Let me know if there is a better way. -- Greg ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE@mail.gmail.com>]
[parent not found: <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2010-05-31 0:43 ` KAMEZAWA Hiroyuki 2010-05-31 1:01 ` Li Zefan 1 sibling, 0 replies; 8+ messages in thread From: KAMEZAWA Hiroyuki @ 2010-05-31 0:43 UTC (permalink / raw) To: Greg Thelen Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Menage, Paul E. McKenney, Andrew Morton On Sun, 30 May 2010 17:44:34 -0700 Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > On Sun, May 30, 2010 at 4:54 PM, KAMEZAWA Hiroyuki > <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > > On Mon, 31 May 2010 08:45:29 +0900 > > KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > > > >> On Fri, 28 May 2010 15:25:08 -0700 > >> Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > >> > >> > On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > >> > > > >> > > Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > >> > > >> > Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > >> > > >> > Good catch, thanks. > >> > > >> Nice Catch. > >> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > >> > >> But, who breaks this ? Do we need backport this against old kernels ? > >> > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fae9c791703606636c1220e47f6690660042ce7f > > > > Hmm. this one. and 2.6.34 needs this patch. Greg, could you post this to > > stable-2.6.34 tree ? > > Given that I forgot to include "Cc: stable <stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>" in the > patch, I assume the best way to get this patch into -stable is for me > to email the commit id to stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org once the patch is accepted > into Linus' tree. Let me know if there is a better way. > Yes, it's best to CC stable-DgEjT+Ai2yi4UlQgPVntAg@public.gmane.org But please specify what version of kernels requires this patch as "for 2.6.34" Thank you, -Kame ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2010-05-31 0:43 ` KAMEZAWA Hiroyuki @ 2010-05-31 1:01 ` Li Zefan 1 sibling, 0 replies; 8+ messages in thread From: Li Zefan @ 2010-05-31 1:01 UTC (permalink / raw) To: Greg Thelen Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Menage, Paul E. McKenney, Andrew Morton >>>> On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: >>>>> Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >>>> Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >>>> >>>> Good catch, thanks. >>>> >>> Nice Catch. >>> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> >>> >>> But, who breaks this ? Do we need backport this against old kernels ? >>> >> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fae9c791703606636c1220e47f6690660042ce7f >> >> Hmm. this one. and 2.6.34 needs this patch. Greg, could you post this to >> stable-2.6.34 tree ? > > Given that I forgot to include "Cc: stable <stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>" in the > patch, I assume the best way to get this patch into -stable is for me > to email the commit id to stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org once the patch is accepted > into Linus' tree. Let me know if there is a better way. > I think Andrew will mark it and send it to stable. ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20100531084529.2b1f0d25.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <20100531084529.2b1f0d25.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2010-05-30 23:54 ` KAMEZAWA Hiroyuki 2010-05-31 0:59 ` Li Zefan 1 sibling, 0 replies; 8+ messages in thread From: KAMEZAWA Hiroyuki @ 2010-05-30 23:54 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Menage, Paul E. McKenney, Andrew Morton On Mon, 31 May 2010 08:45:29 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > On Fri, 28 May 2010 15:25:08 -0700 > Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > > > On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > > > > > > Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > > > > Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > > > > Good catch, thanks. > > > Nice Catch. > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > > But, who breaks this ? Do we need backport this against old kernels ? > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fae9c791703606636c1220e47f6690660042ce7f Hmm. this one. and 2.6.34 needs this patch. Greg, could you post this to stable-2.6.34 tree ? Thanks, -Kame ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth [not found] ` <20100531084529.2b1f0d25.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> 2010-05-30 23:54 ` KAMEZAWA Hiroyuki @ 2010-05-31 0:59 ` Li Zefan 1 sibling, 0 replies; 8+ messages in thread From: Li Zefan @ 2010-05-31 0:59 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Paul Menage, Paul E. McKenney, Andrew Morton 07:45, KAMEZAWA Hiroyuki wrote: > On Fri, 28 May 2010 15:25:08 -0700 > Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: > >> On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: >>> Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >> Acked-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> >> >> Good catch, thanks. >> > Nice Catch. > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > > But, who breaks this ? Do we need backport this against old kernels ? > Oops, I broke it, and it needs to be backported to 2.6.34.. Thanks for catching this! Acked-by: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] cgroup: alloc_css_id() increments hierarchy depth @ 2010-05-28 15:16 Greg Thelen 0 siblings, 0 replies; 8+ messages in thread From: Greg Thelen @ 2010-05-28 15:16 UTC (permalink / raw) To: Paul Menage, Paul E. McKenney, Li Zefan Cc: Ben Blum, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Morton Child groups should have a greater depth than their parents. Prior to this change, the parent would incorrectly report zero memory usage for child cgroups when use_hierarchy is enabled. test script: mount -t cgroup none /cgroups -o memory cd /cgroups mkdir cg1 echo 1 > cg1/memory.use_hierarchy mkdir cg1/cg11 echo $$ > cg1/cg11/tasks dd if=/dev/zero of=/tmp/foo bs=1M count=1 echo echo CHILD grep cache cg1/cg11/memory.stat echo echo PARENT grep cache cg1/memory.stat echo $$ > tasks rmdir cg1/cg11 cg1 cd / umount /cgroups Using fae9c79, a recent patch that changed alloc_css_id() depth computation, the parent incorrectly reports zero usage: root@ubuntu:~# ./test 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.0151844 s, 69.1 MB/s CHILD cache 1048576 total_cache 1048576 PARENT cache 0 total_cache 0 With this patch, the parent correctly includes child usage: root@ubuntu:~# ./test 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.0136827 s, 76.6 MB/s CHILD cache 1052672 total_cache 1052672 PARENT cache 0 total_cache 1052672 Signed-off-by: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> --- kernel/cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 422cb19..3ac6f5b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -4598,7 +4598,7 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent, parent_css = parent->subsys[subsys_id]; child_css = child->subsys[subsys_id]; parent_id = parent_css->id; - depth = parent_id->depth; + depth = parent_id->depth + 1; child_id = get_new_cssid(ss, depth); if (IS_ERR(child_id)) -- 1.7.0.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-05-31 1:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1275059781-9831-1-git-send-email-gthelen@google.com>
[not found] ` <1275059781-9831-1-git-send-email-gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2010-05-28 22:25 ` [PATCH] cgroup: alloc_css_id() increments hierarchy depth Paul Menage
[not found] ` <AANLkTino0k-wok9kXLmWTyr40dZKSCnR0Uk41uxAj5k1@mail.gmail.com>
[not found] ` <AANLkTino0k-wok9kXLmWTyr40dZKSCnR0Uk41uxAj5k1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-30 23:45 ` KAMEZAWA Hiroyuki
[not found] ` <20100531084529.2b1f0d25.kamezawa.hiroyu@jp.fujitsu.com>
[not found] ` <20100531085431.a45b30b9.kamezawa.hiroyu@jp.fujitsu.com>
[not found] ` <20100531085431.a45b30b9.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2010-05-31 0:44 ` Greg Thelen
[not found] ` <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE@mail.gmail.com>
[not found] ` <AANLkTilNrrsNluDBUlXCsZMz7d_-VHn31Ogvkw9AUPnE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-31 0:43 ` KAMEZAWA Hiroyuki
2010-05-31 1:01 ` Li Zefan
[not found] ` <20100531084529.2b1f0d25.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2010-05-30 23:54 ` KAMEZAWA Hiroyuki
2010-05-31 0:59 ` Li Zefan
2010-05-28 15:16 Greg Thelen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox