Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-25 Thread Jarek Poplawski
On Tue, Sep 25, 2007 at 01:47:05PM +0200, Jarek Poplawski wrote: > On Mon, Sep 24, 2007 at 11:50:23AM +0200, Nadia Derbey wrote: > > Jarek Poplawski wrote: > ... > > >2. I'm not sure this refcounting with ipc_rcu_getref/putref is SMP > > >safe (memory barriers): it's not atomic, so locking is neede

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-25 Thread Jarek Poplawski
On Mon, Sep 24, 2007 at 11:50:23AM +0200, Nadia Derbey wrote: > Jarek Poplawski wrote: ... > >2. I'm not sure this refcounting with ipc_rcu_getref/putref is SMP > >safe (memory barriers): it's not atomic, so locking is needed, but > >e.g. in do_msgsnd() kern_ipc_perm lock is used for this, while >

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-24 Thread Nadia Derbey
Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 03:08:42PM +0200, Nadia Derbey wrote: Nadia Derbey wrote: Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: ... Actually, ipc_lock() is called most of the time without the ipc_ids.mutex held and without r

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-24 Thread Nadia Derbey
Jarek Poplawski wrote: On Fri, Sep 21, 2007 at 01:03:47PM +0200, Jarek Poplawski wrote: ... I hope not! But, then it would be probably another logical trick: ipc_rcu_getref/putref() seems to prevent kfreeing of a structure, so if it's used in do_msgsnd() there should be a risk something can do

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-24 Thread Jarek Poplawski
On Mon, Sep 24, 2007 at 08:54:07AM +0200, Jarek Poplawski wrote: > After rethinking, this scenario seems to be wrong or very unprobable > (I'm not sure of all ways "if (--container...)" could be compiled), > so there should be no such risk - double kfree/vfree is more probable, > so no danger. More

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-23 Thread Jarek Poplawski
On Fri, Sep 21, 2007 at 01:03:47PM +0200, Jarek Poplawski wrote: ... > I hope not! But, then it would be probably another logical trick: > ipc_rcu_getref/putref() seems to prevent kfreeing of a structure, so > if it's used in do_msgsnd() there should be a risk something can do > this kfree at this

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-21 Thread Jarek Poplawski
On Fri, Sep 21, 2007 at 01:03:47PM +0200, Jarek Poplawski wrote: ... > any of them does ipc_rcu_getref() a bit later and sees old (cached) Should be: "any of them does ipc_rcu_putref() a bit later and sees old (cached)" Sorry, Jarek P. - To unsubscribe from this list: send the line "unsubscribe l

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-21 Thread Jarek Poplawski
On Fri, Sep 21, 2007 at 12:11:15PM +0200, Nadia Derbey wrote: > Jarek Poplawski wrote: ... > >2. I'm not sure this refcounting with ipc_rcu_getref/putref is SMP > >safe (memory barriers): it's not atomic, so locking is needed, but > >e.g. in do_msgsnd() kern_ipc_perm lock is used for this, while >

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-21 Thread Nadia Derbey
Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 03:08:42PM +0200, Nadia Derbey wrote: Nadia Derbey wrote: Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: ... Actually, ipc_lock() is called most of the time without the ipc_ids.mutex held and without r

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-21 Thread Nadia Derbey
Andrew Morton wrote: On Tue, 18 Sep 2007 16:55:19 +0200 Nadia Derbey <[EMAIL PROTECTED]> wrote: This patch fixes the missing rcu_read_(un)lock in the ipc code Thanks. Could you please check the code comments in ipc/util.c for accuracy and completeness sometime? Done - see attachment. Ho

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-21 Thread Jarek Poplawski
On Thu, Sep 20, 2007 at 03:08:42PM +0200, Nadia Derbey wrote: > Nadia Derbey wrote: > >Jarek Poplawski wrote: > > > >>On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: ... > >Actually, ipc_lock() is called most of the time without the > >ipc_ids.mutex held and without refcounting (mayb

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Jarek Poplawski
On Thu, Sep 20, 2007 at 03:08:42PM +0200, Nadia Derbey wrote: ... > So, here is the ipc_lock_by_ptr() status: > 1) do_msgsnd(), semctl_main(GETALL), semctl_main(SETALL) and find_undo() > call it inside a refcounting. > ==> no rcu read section needed. > > 2) *_exit_ns(), ipc_findkey() and sysvip

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Jarek Poplawski
On Thu, Sep 20, 2007 at 10:52:43AM +0200, Nadia Derbey wrote: > Jarek Poplawski wrote: ... > >which seems to suggest "out" is an RCU protected pointer, so, I > >thought these refcounts were for something else. But, after looking > >at how it's used it turns out to be ~90% wrong: probably 9 out of 1

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Nadia Derbey
Nadia Derbey wrote: Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: Jarek Poplawski wrote: On 18-09-2007 16:55, Nadia Derbey wrote: ... Well, reviewing the code I found another place where the rcu_read_unlock() was missing. I'm so sorry for the inconv

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Nadia Derbey
Jarek Poplawski wrote: On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: Jarek Poplawski wrote: On 18-09-2007 16:55, Nadia Derbey wrote: ... Well, reviewing the code I found another place where the rcu_read_unlock() was missing. I'm so sorry for the inconvenience. It's true tha

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Jarek Poplawski
On Thu, Sep 20, 2007 at 09:28:21AM +0200, Jarek Poplawski wrote: > On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: ... > > Before Calling msg_unlock() they call ipc_rcu_getref() that increments a > > refcount in the rcu header for the msg structure. This guarantees that > > the the

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-20 Thread Jarek Poplawski
On Thu, Sep 20, 2007 at 08:24:58AM +0200, Nadia Derbey wrote: > Jarek Poplawski wrote: > >On 18-09-2007 16:55, Nadia Derbey wrote: > >... > > > >>Well, reviewing the code I found another place where the > >>rcu_read_unlock() was missing. > >>I'm so sorry for the inconvenience. It's true that I sho

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-19 Thread Nadia Derbey
Jarek Poplawski wrote: On 18-09-2007 16:55, Nadia Derbey wrote: ... Well, reviewing the code I found another place where the rcu_read_unlock() was missing. I'm so sorry for the inconvenience. It's true that I should have tested with CONFIG_PREEMPT=y :-( Now, the ltp tests pass even with this

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-19 Thread Jarek Poplawski
On 18-09-2007 16:55, Nadia Derbey wrote: ... > > Well, reviewing the code I found another place where the > rcu_read_unlock() was missing. > I'm so sorry for the inconvenience. It's true that I should have tested > with CONFIG_PREEMPT=y :-( > Now, the ltp tests pass even with this option set...

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Peter Zijlstra
On Tue, 18 Sep 2007 11:29:24 -0700 "Paul E. McKenney" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 18, 2007 at 09:57:15AM -0700, Andrew Morton wrote: > > On Tue, 18 Sep 2007 09:13:37 -0700 "Paul E. McKenney" <[EMAIL PROTECTED]> > > wrote: > > > > > On Tue, Sep 18, 2007 at 02:24:51PM +0200, Peter Zij

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Paul E. McKenney
On Tue, Sep 18, 2007 at 09:57:15AM -0700, Andrew Morton wrote: > On Tue, 18 Sep 2007 09:13:37 -0700 "Paul E. McKenney" <[EMAIL PROTECTED]> > wrote: > > > On Tue, Sep 18, 2007 at 02:24:51PM +0200, Peter Zijlstra wrote: > > > On Tue, 18 Sep 2007 03:34:00 -0700 Andrew Morton > > > <[EMAIL PROTECTED]

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 09:13:37 -0700 "Paul E. McKenney" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 18, 2007 at 02:24:51PM +0200, Peter Zijlstra wrote: > > On Tue, 18 Sep 2007 03:34:00 -0700 Andrew Morton > > <[EMAIL PROTECTED]> wrote: > > > > > Well, it was an optimisation. spin_lock() implies rcu_r

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 16:55:19 +0200 Nadia Derbey <[EMAIL PROTECTED]> wrote: > This patch fixes the missing rcu_read_(un)lock in the ipc code Thanks. Could you please check the code comments in ipc/util.c for accuracy and completeness sometime? - To unsubscribe from this list: send the line "unsub

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Paul E. McKenney
On Tue, Sep 18, 2007 at 02:24:51PM +0200, Peter Zijlstra wrote: > On Tue, 18 Sep 2007 03:34:00 -0700 Andrew Morton > <[EMAIL PROTECTED]> wrote: > > > Well, it was an optimisation. spin_lock() implies rcu_read_lock(). That's > > a bit dirty and we might choose to not do that. > > Not true for th

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Nadia Derbey
Andrew Morton wrote: On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: I'm getting tons of this, and X fails to start CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_BKL

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 12:30:52 +0200 Nadia Derbey <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> > > wrote: > > > > > >>I'm getting tons of this, and X fails to start > >> > >>CONFIG_SYSVIPC=y > >>CONFIG_SYSVIPC_SYSCTL=

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Alexey Dobriyan
On Tue, Sep 18, 2007 at 03:27:27AM -0700, Andrew Morton wrote: > On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > > > I'm getting tons of this, and X fails to start > > > > CONFIG_SYSVIPC=y > > CONFIG_SYSVIPC_SYSCTL=y > > # CONFIG_PREEMPT_NONE is not set > > # CONFI

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > I'm getting tons of this, and X fails to start > > CONFIG_SYSVIPC=y > CONFIG_SYSVIPC_SYSCTL=y > # CONFIG_PREEMPT_NONE is not set > # CONFIG_PREEMPT_VOLUNTARY is not set > CONFIG_PREEMPT=y > CONFIG_PREEMPT_BKL=y > CONF

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Nadia Derbey
Andrew Morton wrote: On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: I'm getting tons of this, and X fails to start CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_BKL

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > I'm getting tons of this, and X fails to start > > CONFIG_SYSVIPC=y > CONFIG_SYSVIPC_SYSCTL=y > # CONFIG_PREEMPT_NONE is not set > # CONFIG_PREEMPT_VOLUNTARY is not set > CONFIG_PREEMPT=y > CONFIG_PREEMPT_BKL=y > CONF

Re: 2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Andrew Morton
On Tue, 18 Sep 2007 13:17:28 +0400 Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > I'm getting tons of this, and X fails to start > > CONFIG_SYSVIPC=y > CONFIG_SYSVIPC_SYSCTL=y > # CONFIG_PREEMPT_NONE is not set > # CONFIG_PREEMPT_VOLUNTARY is not set > CONFIG_PREEMPT=y > CONFIG_PREEMPT_BKL=y > CONF

2.6.23-rc6-mm1: IPC: sleeping function called ...

2007-09-18 Thread Alexey Dobriyan
I'm getting tons of this, and X fails to start CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_BKL=y CONFIG_DEBUG_PREEMPT=y BUG: sleeping function called from invalid context at kernel/rwsem.c:47 in_at