From: Tejun Heo <tj@kernel.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mandeep Singh Baines <msb@chromium.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Li Zefan <lizf@cn.fujitsu.com>,
LKML <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] cgroup: Walk task list under tasklist_lock in cgroup_enable_task_cg_list
Date: Tue, 21 Feb 2012 17:00:15 -0800 [thread overview]
Message-ID: <20120222010015.GH12236@google.com> (raw)
In-Reply-To: <20120222005525.GC13403@somewhere.redhat.com>
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.
Thanks.
--
tejun
next prev parent reply other threads:[~2012-02-22 1:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 2:37 [RFC][PATCH 0/2] cgroup: Fix some races against css_set task links Frederic Weisbecker
2012-02-08 2:37 ` [PATCH 1/2] cgroup: Remove wrong comment on cgroup_enable_task_cg_list() Frederic Weisbecker
2012-02-08 2:37 ` [PATCH 2/2] cgroup: Walk task list under tasklist_lock in cgroup_enable_task_cg_list Frederic Weisbecker
2012-02-21 22:23 ` Mandeep Singh Baines
2012-02-22 0:55 ` Frederic Weisbecker
2012-02-22 1:00 ` Tejun Heo [this message]
2012-02-22 1:04 ` Frederic Weisbecker
2012-02-22 1:06 ` Tejun Heo
2012-02-22 1:10 ` Frederic Weisbecker
2012-02-22 1:19 ` Paul E. McKenney
2012-02-22 1:33 ` Frederic Weisbecker
2012-02-22 18:03 ` Oleg Nesterov
2012-02-27 18:57 ` Frederic Weisbecker
2012-02-17 5:41 ` [RFC][PATCH 0/2] cgroup: Fix some races against css_set task links Li Zefan
2012-02-21 17:16 ` Tejun Heo
2012-02-21 17:42 ` Frederic Weisbecker
2012-02-21 17:46 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120222010015.GH12236@google.com \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=msb@chromium.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox