lkml.org 
[lkml]   [2009]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH] Reduce size of swap_cgroup by CSS ID
From
Paul E. McKenney wrote:
> On Thu, Feb 05, 2009 at 06:59:59PM +0900, KAMEZAWA Hiroyuki wrote:

>> +static struct mem_cgroup *mem_cgroup_lookup_get(unsigned short id)
>> +{
>> + struct cgroup_subsys_state *css;
>> +
>> + /* ID 0 is unused ID */
>> + if (!id)
>> + return NULL;
>> + css = css_lookup(&mem_cgroup_subsys, id);
>> + if (css && css_tryget(css))
>> + return container_of(css, struct mem_cgroup, css);
>
> So css_tryget(), if successful, prevents the structure referenced by
> css from being freed, correct? (If not, the range of the RCU read-side
> critical sections surrounding calls to mem_cgroup_lookup_get() must be
> extended.)
>
One reference to css by css_tryget() prevents rmdir(). So, css will
not be freed until css_put() is called.

Thanks,
-Kame



\
 
 \ /
  Last update: 2009-02-05 14:29    [W:0.076 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site