lkml.org 
[lkml]   [2008]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/2] CGROUP ID and Hierarchy Code
On Fri, 28 Nov 2008 10:35:33 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> On Fri, 28 Nov 2008 09:28:33 +0800
> Li Zefan <lizf@cn.fujitsu.com> wrote:

> > I think the safe way is:
> >
> > rcu_read_lock();
> > cgrp = cgroup_get_next()
> > if (!inc_not_zero(cgrp) {
> > rcu_read_unlock();
> > return NULL;
> > }
> > rcu_read_unlock();
> > return cgrp;
> >
> > But it's also safe to use cgrp = list_entry(&parent->children.next) for the above
> > scenario, seems you don't have to invent this cgroup_get_next().
> >
> But list-walk can't provide us view of hierarchy. Up-Down list walk is better ?
> please see memcg's code. it met some troubles.
> I'll make kfree(cgrp) to be called by RCU.
>

Ah please, I have a question.
Following is right ?
- until mount, cgroup's subsystem root is tied to dummy? root cgroup.
- cgroup cannot be unmounted while there are any children.
- cgroup_root is freed/allocated at umount/mount, then I have to handle
this event in cgroup-id.
(maybe current code has leak? in umount.)

Thanks,
-Kame



\
 
 \ /
  Last update: 2008-11-28 03:21    [W:0.045 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site