suspect locking in net/irda/iriap.c
Subsystems (2)
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
David Miller
maintainerFrom: Dave Jones <[email protected]>
Date: Wed, 20 Apr 2011 23:40:58 -0400
Quoted 2 lines
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.
--- net/irda/iriap.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
net/irda/iriap.c +5 -0
@@ -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 */
Signature · 1 line
1.7.5.2
Quoted 8 lines · David Miller
From: Dave Jones <[email protected]>
Date: Wed, 20 Apr 2011 23:40:58 -0400Quoted 2 lines
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