[lkml]   [2013]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/6] cgroup: initialize cgrp->dentry before css_alloc()
On 2013/1/23 8:27, Tejun Heo wrote:
> (cc'ing Andrew as scheduler folks are difficult to get response from
> these days and I can't think of anyone else to bother :)
> Hello, Li.
> The cgroup part looks good to me but it would be great if the
> descriptions are more detailed, especially, about why the change is
> beneficial or what it's aiming at. I take it that the shed changes
> are necessary to facilitate the later cgroup changes? Can you please
> elaborate how?

Scheduler changes made in patch #2 are preparation for #3 and #4.

- for #3:

After ss->css_alloc(), there's a small window that tg->css.cgroup is NULL.
With the change, tg won't be seen before ss->css_online(), so the scheduler
won't see NULL tg->css.cgroup.

- for #4:

If tg is unregistered and removed from global list in css_free(), and if
we kfree cgroup right after ss->css_free(), the scheduler can access
invalid tg->css.cgroup, because tg is also protected by RCU.

Without patch #2:

no ss->css_offline()
ss->css_free() <-- remove tg from global list,
and free tg via call_rcu()
kfree_rcu(cgroup) <-- wait rcu read section

With the change:

ss->css_offline() <-- remove tg from global list
synchronize_rcu() <-- wait rcu read section
ss->css_free(); <-- free tg

> The scheduler part of changes are mostly mechanical, so it would be
> great if we can get ack from scheduler people and route these together.
> Thanks.

 \ /
  Last update: 2013-01-23 04:21    [W:0.086 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site