lkml.org 
[lkml]   [2012]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] cgroup: Walk task list under tasklist_lock in cgroup_enable_task_cg_list
On Tue, Feb 21, 2012 at 05:00:15PM -0800, Tejun Heo wrote:
> On Wed, Feb 22, 2012 at 01:55:28AM +0100, Frederic Weisbecker wrote:
> > > > + * We need tasklist_lock because RCU is not safe against
> > > > + * while_each_thread(). Besides, a forking task that has passed
> > > > + * cgroup_post_fork() without seeing use_task_css_set_links = 1
> > > > + * is not guaranteed to have its child immediately visible in the
> > > > + * tasklist if we walk through it with RCU.
> > > > + */
> > >
> > > Maybe add TODO to remove the lock once do_each_thread()/while_each_thread()
> > > is made rcu safe. On a large system, it could take a while to iterate
> > > over every thread in the system. Thats a long time to hold a spinlock.
> > > But it only happens once so probably not that big a deal.
> >
> > I think that even if while_each_thread() was RCU safe, that wouldn't
> > work here.
>
> Guys, this is one time thing. It happens *once* after boot and we're
> already holding exclusive lock. There's no reason to optimize this at
> all. Let's just keep it simple.

For now I agree. But one day the real time guys might eye that thing.


\
 
 \ /
  Last update: 2012-02-22 02:07    [from the cache]
©2003-2011 Jasper Spaans