lkml.org 
[lkml]   [2008]   [Nov]   [8]   [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 (v2)
Li Zefan wrote:
>> +static int mem_cgroup_hierarchy_write(struct cgroup *cont, struct cftype *cft,
>> + u64 val)
>> +{
>> + int retval = 0;
>> + struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
>> +
>> + if (val == 1) {
>> + if (list_empty(&cont->children))
>
> cgroup_lock should be held before checking cont->children.
>

Good point, I'll look at that aspect

>> + mem->use_hierarchy = val;
>> + else
>> + retval = -EBUSY;
>> + } else if (val == 0) {
>
> And code duplicate.

Yes, this can be optimized better. I'll fix that in v3.

>
>> + if (list_empty(&cont->children))
>> + mem->use_hierarchy nn= val;
>> + else
>> + retval = -EBUSY;
>> + } else
>> + retval = -EINVAL;
>> +
>> + return retval;
>> +}
>> +
>


--
Balbir


\
 
 \ /
  Last update: 2008-11-08 10:53    [W:0.063 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site