lkml.org 
[lkml]   [2008]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][mm] [PATCH 4/4] Memory cgroup hierarchy feature selector (v3)
> +	/*
> + * If parent's use_hiearchy is set, we can't make any modifications
> + * in the child subtrees. If it is unset, then the change can
> + * occur, provided the current cgroup has no children.
> + *
> + * For the root cgroup, parent_mem is NULL, we allow value to be
> + * set if there are no children.
> + */
> + if (!parent_mem || (!parent_mem->use_hierarchy &&
> + (val == 1 || val == 0))) {
> + if (list_empty(&cont->children))
> + mem->use_hierarchy = val;
> + else
> + retval = -EBUSY;
> + } else
> + retval = -EINVAL;
> +
> + return retval;
> +}

As I mentioned there is a race here. :(

echo 1 > /memcg/memory.use_hierarchy
=>if (list_empty(&cont->children))
mkdir /memcg/0
=> mem->use_hierarchy = 0
mem->use_hierarchy = 1;

Now it ends up with parent's use_hierarchy is set but its child's
use_hierarchy is not set.


\
 
 \ /
  Last update: 2008-11-13 02:33    [W:2.049 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site