Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Linus Torvalds
On Sat, Mar 2, 2013 at 9:32 PM, Davidlohr Bueso wrote: > > After updating the callers, [msgctl, semctl, shmctl]_down, to acquire > the lock for IPC_RMID and IPC_SET commands, I'm no longer seeing these > issues - so far on my regular laptop and two big boxes running my Oracle > benchmarks for a fe

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Mike Galbraith
On Sat, 2013-03-02 at 21:18 -0500, Rik van Riel wrote: > On 03/01/2013 11:32 PM, Michel Lespinasse wrote: > > > I think it may be nicer to take the rcu read lock at the call site > > rather than in ipc_obtain_object(), to make the rcu read lock/unlock > > sites pair up more nicely. Either that or

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Davidlohr Bueso
On Sat, 2013-03-02 at 13:24 -0800, Linus Torvalds wrote: > On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso > wrote: > > @@ -784,7 +806,7 @@ struct kern_ipc_perm *ipcctl_pre_down(struct > > ipc_namespace *ns, > > int err; > > > > down_write(&ids->rw_mutex); > > - ipcp = ipc_

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Rik van Riel
On 03/01/2013 11:32 PM, Michel Lespinasse wrote: I think it may be nicer to take the rcu read lock at the call site rather than in ipc_obtain_object(), to make the rcu read lock/unlock sites pair up more nicely. Either that or make an inline ipc_release_object function that pairs up with ipc_obt

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Linus Torvalds
On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso wrote: > @@ -784,7 +806,7 @@ struct kern_ipc_perm *ipcctl_pre_down(struct > ipc_namespace *ns, > int err; > > down_write(&ids->rw_mutex); > - ipcp = ipc_lock_check(ids, id); > + ipcp = ipc_obtain_object_check(ids, id); >

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-01 Thread Michel Lespinasse
On Sat, Mar 2, 2013 at 8:16 AM, Davidlohr Bueso wrote: > Through ipc_lock() and, therefore, ipc_lock_check() we currently > return the locked ipc object. This is not necessary for all situations, > thus introduce, analogous, ipc_obtain_object and ipc_obtain_object_check > functions that only mark

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-01 Thread Linus Torvalds
On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso wrote: > > +struct kern_ipc_perm *ipc_obtain_object(struct ipc_ids *ids, int id) This looks good.. > +struct kern_ipc_perm *ipc_obtain_object_check(struct ipc_ids *ids, int id) The comment on ipc_checkid() says that it should only be called with t

[RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-01 Thread Davidlohr Bueso
Through ipc_lock() and, therefore, ipc_lock_check() we currently return the locked ipc object. This is not necessary for all situations, thus introduce, analogous, ipc_obtain_object and ipc_obtain_object_check functions that only mark the RCU read critical region without acquiring the lock and retu