Thread (29 messages) flat view 29 messages, 3 authors, 2011-12-12

Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller

From: Glauber Costa <hidden>
Date: 2011-12-09 14:38:12
Also in: cgroups, linux-mm, lkml

On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote:
Hm, why you check val != parent->kmem_independent_accounting ?

	if (parent&&  parent->use_hierarchy)
		return -EINVAL;
?

BTW, you didn't check this cgroup has children or not.
I think

	if (this_cgroup->use_hierarchy&&
              !list_empty(this_cgroup->childlen))
		return -EINVAL;
How about this?

         val = !!val;

         /*
          * This follows the same hierarchy restrictions than
          * mem_cgroup_hierarchy_write()
          */
         if (!parent || !parent->use_hierarchy) {
                 if (list_empty(&cgroup->children))
                         memcg->kmem_independent_accounting = val;
                 else
                         return -EBUSY;
         }
         else
                 return -EINVAL;

         return 0;

--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help