Re: [PATCH v4 2/2] cgroups: make procs file writable

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ben Blum
Date: Tuesday, August 3, 2010 - 9:38 pm

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v4 2/2] cgroups: make procs file writable, Ben Blum, (Fri Jul 30, 4:59 pm)
Re: [PATCH v4 2/2] cgroups: make procs file writable, KAMEZAWA Hiroyuki, (Tue Aug 3, 6:08 pm)
Re: [PATCH v4 2/2] cgroups: make procs file writable, Paul Menage, (Tue Aug 3, 9:30 pm)
Re: [PATCH v4 2/2] cgroups: make procs file writable, Ben Blum, (Tue Aug 3, 9:38 pm)
Re: [PATCH v4 2/2] cgroups: make procs file writable, Paul Menage, (Tue Aug 3, 9:46 pm)
Re: [PATCH v4 1/2] cgroups: read-write lock CLONE_THREAD f ..., KAMEZAWA Hiroyuki, (Fri Aug 6, 12:08 am)
[PATCH v5 3/3] cgroups: make procs file writable, Ben Blum, (Tue Aug 10, 10:48 pm)
Re: [PATCH v5 3/3] cgroups: make procs file writable, Paul Menage, (Tue Aug 24, 11:08 am)
[PATCH v6 3/3] cgroups: make procs file writable, Ben Blum, (Fri Dec 24, 1:24 am)
[PATCH v7 3/3] cgroups: make procs file writable, Ben Blum, (Sun Dec 26, 5:12 am)