On Tue, Aug 03, 2010 at 09:30:00PM -0700, Paul Menage wrote:
It was either this or:
rcu_read_lock();
for_each_subsys(...) {
can_attach(...);
}
rcu_read_unlock();
Which forces all can_attaches to not sleep. So by dropping
rcu_read_lock(), we allow the possibility of the exec race I described
in my last email, and therefore we have to check each time we re-acquire
rcu_read to iterate thread_group.
Yeah, it is not pretty. I call it "double-double-toil-and-trouble-check
locking". But it is safe.
-- Ben
--