Re: Need lockdep help

2007-12-04 Thread Ingo Molnar
* Alan Stern <[EMAIL PROTECTED]> wrote: > > I'm not sure I can understand your plan, but I doubt there should be > > such problems with taking rwsem for sleeping, so maybe it would be > > better to figure out what really scares lockdep, to fix the right > > place? > > The real problem is that

Re: Need lockdep help

2007-12-04 Thread Jarek Poplawski
Alan Stern wrote, On 12/04/2007 08:28 PM: > On Tue, 4 Dec 2007, Jarek Poplawski wrote: ... > But you have to consider hypothetical kernel bugs. That's exactly what > lockdep is for -- to warn you about possible deadlocks that could be > caused by bugs. > > As a simple example, if thread #1 d

Re: Need lockdep help

2007-12-04 Thread Alan Stern
On Tue, 4 Dec 2007, Jarek Poplawski wrote: > Alan Stern wrote, On 12/04/2007 04:17 PM: > ... > > > Furthermore, in this case deadlock isn't really impossible -- it could > > occur if there were a bug somewhere else in the kernel. So lockdep was > > correct to warn that deadlock might occur. >

Re: Need lockdep help

2007-12-04 Thread Jarek Poplawski
Alan Stern wrote, On 12/04/2007 04:17 PM: ... > Furthermore, in this case deadlock isn't really impossible -- it could > occur if there were a bug somewhere else in the kernel. So lockdep was > correct to warn that deadlock might occur. Alan, if the scenario was like you described at the begi

Re: Need lockdep help

2007-12-04 Thread Alan Stern
On Tue, 4 Dec 2007, Jarek Poplawski wrote: > Alan Stern wrote, On 12/03/2007 04:08 PM: > > > On Mon, 3 Dec 2007, Jarek Poplawski wrote: > > > >> Actually, IMHO, there is no reason for any lockdep violation: > >> > >> thread #1: has down_read(A); waits for #2 to down_write(B) > >> thread #2: has

Re: Need lockdep help

2007-12-03 Thread Jarek Poplawski
Alan Stern wrote, On 12/03/2007 04:08 PM: > On Mon, 3 Dec 2007, Jarek Poplawski wrote: > >>> System sleep start: >>> down_read(notifier-chain rwsem); >>> call the notifier routine >>> down_write(&system_sleep_in_progress_rwsem); >>> up_read(

Re: Need lockdep help

2007-12-03 Thread Alan Stern
On Mon, 3 Dec 2007, Jarek Poplawski wrote: > > System sleep start: > > down_read(notifier-chain rwsem); > > call the notifier routine > > down_write(&system_sleep_in_progress_rwsem); > > up_read(notifier-chain rwsem); > > > > System sleep en

Re: Need lockdep help

2007-12-03 Thread Jarek Poplawski
On 02-12-2007 20:45, Alan Stern wrote: > Ingo: > > I ran into a lockdep reporting issue just now with some new code under > development. I think it's a false positive; the question is how best > to deal with it. > > Here's the situation. The new code runs during a system sleep (i.e., > suspe

Re: Need lockdep help

2007-12-02 Thread Alan Stern
On Sun, 2 Dec 2007, Arjan van de Ven wrote: > > This creates a lockdep violation; each rwsem in turn is locked while > > the other is being held. However the only way this could lead to > > deadlock would be if there was already a bug in the system Power > > Management code (overlapping notifi

Re: Need lockdep help

2007-12-02 Thread Arjan van de Ven
On Sun, 2 Dec 2007 14:45:32 -0500 (EST) Alan Stern <[EMAIL PROTECTED]> wrote: > Ingo: > > I ran into a lockdep reporting issue just now with some new code > under development. I think it's a false positive; the question is > how best to deal with it. > > Here's the situation. The new code runs

Need lockdep help

2007-12-02 Thread Alan Stern
Ingo: I ran into a lockdep reporting issue just now with some new code under development. I think it's a false positive; the question is how best to deal with it. Here's the situation. The new code runs during a system sleep (i.e., suspend or hibernation). Certain activities have to be defe