* suspect locking in net/irda/iriap.c
@ 2011-04-21 3:40 Dave Jones
2011-06-07 0:00 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2011-04-21 3:40 UTC (permalink / raw)
To: netdev; +Cc: Samuel Ortiz
I just hit this..
=============================================
[ INFO: possible recursive locking detected ]
2.6.39-rc4+ #13
---------------------------------------------
trinity/11336 is trying to acquire lock:
(&(&hashbin->hb_spinlock)->rlock){......}, at: [<ffffffffa0653074>] irias_seq_show+0x4f/0x13b [irda]
but task is already holding lock:
(&(&hashbin->hb_spinlock)->rlock){......}, at: [<ffffffffa0653669>] irias_seq_start+0x1e/0x59 [irda]
other info that might help us debug this:
2 locks held by trinity/11336:
#0: (&p->lock){+.+.+.}, at: [<ffffffff811562b6>] seq_read+0x3d/0x367
#1: (&(&hashbin->hb_spinlock)->rlock){......}, at: [<ffffffffa0653669>] irias_seq_start+0x1e/0x59 [irda]
stack backtrace:
Pid: 11336, comm: trinity Not tainted 2.6.39-rc4+ #13
Call Trace:
[<ffffffff8108a7fd>] __lock_acquire+0x89b/0xc81
[<ffffffffa0653074>] ? irias_seq_show+0x4f/0x13b [irda]
[<ffffffff8108b0e3>] lock_acquire+0x108/0x133
[<ffffffffa0653074>] ? irias_seq_show+0x4f/0x13b [irda]
[<ffffffff814cc14b>] _raw_spin_lock+0x40/0x73
[<ffffffffa0653074>] ? irias_seq_show+0x4f/0x13b [irda]
[<ffffffffa0653074>] irias_seq_show+0x4f/0x13b [irda]
[<ffffffff811564fe>] seq_read+0x285/0x367
[<ffffffff81156279>] ? seq_lseek+0xe8/0xe8
[<ffffffff8118a192>] proc_reg_read+0x90/0xaf
[<ffffffff8113ab26>] vfs_read+0xac/0xf3
[<ffffffff8113c043>] ? fget_light+0x3a/0xa1
[<ffffffff8113abba>] sys_read+0x4d/0x74
[<ffffffff814d2d02>] system_call_fastpath+0x16/0x1b
irias_seq_start does this ..
996 {
997 spin_lock_irq(&irias_objects->hb_spinlock);
998
999 return *pos ? irias_seq_idx(*pos - 1) : SEQ_START_TOKEN;
1000 }
and then unlocks it in irias_seq_stop.
meanwhile in the seq_show iterator ...
1029 /* Careful for priority inversions here !
1030 * All other uses of attrib spinlock are independent of
1031 * the object spinlock, so we are safe. Jean II */
1032 spin_lock(&obj->attribs->hb_spinlock);
My reading of that comment suggests that the two locks aren't the same,
so is this just missing a lockdep annotation ?
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: suspect locking in net/irda/iriap.c
2011-04-21 3:40 suspect locking in net/irda/iriap.c Dave Jones
@ 2011-06-07 0:00 ` David Miller
2011-06-07 0:13 ` Dave Jones
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-06-07 0:00 UTC (permalink / raw)
To: davej; +Cc: netdev, samuel
From: Dave Jones <davej@redhat.com>
Date: Wed, 20 Apr 2011 23:40:58 -0400
> My reading of that comment suggests that the two locks aren't the same,
> so is this just missing a lockdep annotation ?
Dave, I'm going to check in the following to net-2.6 to try and
address this. Let me know how it works for you.
--------------------
irda: iriap: Use seperate lockdep class for irias_objects->hb_spinlock
The SEQ output functions grab the obj->attrib->hb_spinlock lock of
sub-objects found in the hash traversal. These locks are in a different
realm than the one used for the irias_objects hash table itself.
So put the latter into it's own lockdep class.
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/irda/iriap.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 3647753..f876eed 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -87,6 +87,8 @@ static inline void iriap_start_watchdog_timer(struct iriap_cb *self,
iriap_watchdog_timer_expired);
}
+static struct lock_class_key irias_objects_key;
+
/*
* Function iriap_init (void)
*
@@ -114,6 +116,9 @@ int __init iriap_init(void)
return -ENOMEM;
}
+ lockdep_set_class_and_name(&irias_objects->hb_spinlock, &irias_objects_key,
+ "irias_objects");
+
/*
* Register some default services for IrLMP
*/
--
1.7.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: suspect locking in net/irda/iriap.c
2011-06-07 0:00 ` David Miller
@ 2011-06-07 0:13 ` Dave Jones
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jones @ 2011-06-07 0:13 UTC (permalink / raw)
To: David Miller; +Cc: netdev, samuel
On Mon, Jun 06, 2011 at 05:00:56PM -0700, David Miller wrote:
> From: Dave Jones <davej@redhat.com>
> Date: Wed, 20 Apr 2011 23:40:58 -0400
>
> > My reading of that comment suggests that the two locks aren't the same,
> > so is this just missing a lockdep annotation ?
>
> Dave, I'm going to check in the following to net-2.6 to try and
> address this. Let me know how it works for you.
will check it out once I'm done bisecting a different bug, thanks.
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-07 0:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-21 3:40 suspect locking in net/irda/iriap.c Dave Jones
2011-06-07 0:00 ` David Miller
2011-06-07 0:13 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).