[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120222010431.GD13403@somewhere.redhat.com>
Date: Wed, 22 Feb 2012 02:04:34 +0100
From: Frederic Weisbecker <fweisbec@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: Mandeep Singh Baines <msb@...omium.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Li Zefan <lizf@...fujitsu.com>,
LKML <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists