lkml.org 
[lkml]   [2009]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] memcg: hierarchical reclaim by CSS ID
>>>>> +	while (!ret) {
>>>>> + rcu_read_lock();
>>>>> + nextid = root_mem->last_scanned_child + 1;
>>>>> + css = css_get_next(&mem_cgroup_subsys, nextid, &root_mem->css,
>>>>> + &found);
>>>>> + if (css && css_is_populated(css) && css_tryget(css))
>>>> I don't see why you need to check css_is_populated(css) ?
>>>>
>>> Main reason is for sanity. I don't like to hold css->refcnt of not populated css.
>> I think this is a rare case. It's just a very short period when a cgroup is
>> being created but not yet fully created.
>>
>>> Second reason is for avoinding unnecessary calls to try_to_free_pages(),
>>> it's heavy. I should also add mem->res.usage == 0 case for skipping but not yet.
>>>
>> And if mem->res.usage == 0 is checked, css_is_popuated() is just redundant.
>>
> Hmm ? Can I check mem->res.usage before css_tryget() ?
>

I think you can. If css != NULL, css is valid (otherwise how can we access css->flags
in css_tryget), so mem is valid. Correct me if I'm wrong. :)




\
 
 \ /
  Last update: 2009-01-16 08:39    [W:0.069 / U:23.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site