Possible irq lock inversion dependency detected in JBD

From: Vladislav Bolkhovitin
Date: Tue Nov 24 2009 - 08:02:23 EST


Hello,

During testing I had the below trace from lockdep. After some googling seems
it wasn't reported. The complete trace attached, it's almost 800K uncompressed.

=========================================================
[ INFO: possible irq lock inversion dependency detected ]
2.6.31-scst-dbg #3
---------------------------------------------------------
kswapd0/290 just changed the state of lock:
(jbd_handle){+.+.-.}, at: [<7826a6fa>] journal_start+0xd4/0x13a
but this lock took another, RECLAIM_FS-unsafe lock in the past:
(&type->s_lock_key){+.+.+.}

and interrupts could create inverse lock ordering between them.


other info that might help us debug this:
no locks held by kswapd0/290.

the first lock's dependencies:
-> (jbd_handle){+.+.-.} ops: 0 {
HARDIRQ-ON-W at:
[<781719d9>] __lock_acquire+0x4e0/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7826a725>] journal_start+0xff/0x13a
[<78261d2e>] ext3_journal_start_sb+0x39/0x70
[<7825d7d5>] ext3_create+0x81/0x10b
[<781ffbbc>] vfs_create+0xa9/0xbd
[<7820296f>] do_filp_open+0x862/0x941
[<781f2943>] do_sys_open+0x7e/0x13a
[<781f2a80>] sys_open+0x33/0x4c
[<7810328b>] sysenter_do_call+0x12/0x32
[<ffffffff>] 0xffffffff
SOFTIRQ-ON-W at:
[<781719ff>] __lock_acquire+0x506/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7826a725>] journal_start+0xff/0x13a
[<78261d2e>] ext3_journal_start_sb+0x39/0x70
[<7825d7d5>] ext3_create+0x81/0x10b
[<781ffbbc>] vfs_create+0xa9/0xbd
[<7820296f>] do_filp_open+0x862/0x941
[<781f2943>] do_sys_open+0x7e/0x13a
[<781f2a80>] sys_open+0x33/0x4c
[<7810328b>] sysenter_do_call+0x12/0x32
[<ffffffff>] 0xffffffff
IN-RECLAIM_FS-W at:
[<78171876>] __lock_acquire+0x37d/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7826a725>] journal_start+0xff/0x13a
[<78261d2e>] ext3_journal_start_sb+0x39/0x70
[<78256ffb>] ext3_ordered_writepage+0xb8/0x1dc
[<781ce157>] shrink_page_list+0x64a/0x7cb
[<781ce966>] shrink_zone+0x68e/0xa6f
[<781cf341>] kswapd+0x5fa/0x625
[<7815ac79>] kthread+0x84/0x8d
[<78103f57>] kernel_thread_helper+0x7/0x10
[<ffffffff>] 0xffffffff
INITIAL USE at:
[<78171677>] __lock_acquire+0x17e/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7826a725>] journal_start+0xff/0x13a
[<78261d2e>] ext3_journal_start_sb+0x39/0x70
[<7825d7d5>] ext3_create+0x81/0x10b
[<781ffbbc>] vfs_create+0xa9/0xbd
[<7820296f>] do_filp_open+0x862/0x941
[<781f2943>] do_sys_open+0x7e/0x13a
[<781f2a80>] sys_open+0x33/0x4c
[<7810328b>] sysenter_do_call+0x12/0x32
[<ffffffff>] 0xffffffff
}
... key at: [<7ad3e6d4>] jbd_handle_key+0x0/0x8
-> (inode_lock){+.+.-.} ops: 0 {
HARDIRQ-ON-W at:
[<781719d9>] __lock_acquire+0x4e0/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7849aca4>] _spin_lock+0x4d/0x8e
[<7820afe4>] ifind_fast+0x29/0xa4
[<7820b310>] iget_locked+0x3d/0x148
[<7824da34>] sysfs_get_inode+0x27/0x1e1
[<7825077e>] sysfs_fill_super+0x59/0xdb
[<781f7b30>] get_sb_single+0x9b/0xc0
[<7825070b>] sysfs_get_sb+0x2e/0x48
[<781f68af>] vfs_kern_mount+0x51/0xab
[<781f692f>] kern_mount_data+0x26/0x3c
[<78657314>] sysfs_init+0x8f/0xc8
[<78655e07>] mnt_init+0x97/0x1b0
[<786558ab>] vfs_caches_init+0xb1/0x155
[<78638b03>] start_kernel+0x319/0x40a
[<78638085>] __init_begin+0x85/0xb0
[<ffffffff>] 0xffffffff
SOFTIRQ-ON-W at:
[<781719ff>] __lock_acquire+0x506/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7849aca4>] _spin_lock+0x4d/0x8e
[<7820afe4>] ifind_fast+0x29/0xa4
[<7820b310>] iget_locked+0x3d/0x148
[<7824da34>] sysfs_get_inode+0x27/0x1e1
[<7825077e>] sysfs_fill_super+0x59/0xdb
[<781f7b30>] get_sb_single+0x9b/0xc0
[<7825070b>] sysfs_get_sb+0x2e/0x48
[<781f68af>] vfs_kern_mount+0x51/0xab
[<781f692f>] kern_mount_data+0x26/0x3c
[<78657314>] sysfs_init+0x8f/0xc8
[<78655e07>] mnt_init+0x97/0x1b0
[<786558ab>] vfs_caches_init+0xb1/0x155
[<78638b03>] start_kernel+0x319/0x40a
[<78638085>] __init_begin+0x85/0xb0
[<ffffffff>] 0xffffffff
IN-RECLAIM_FS-W at:
[<78171876>] __lock_acquire+0x37d/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7849aca4>] _spin_lock+0x4d/0x8e
[<782a0bcf>] _atomic_dec_and_lock+0x63/0x84
[<78209b05>] iput+0x33/0x75
[<7825006f>] sysfs_d_iput+0x39/0x57
[<78206d24>] dentry_iput+0x6d/0xfc
[<78206eb5>] d_kill+0x30/0x5e
[<782070f5>] __shrink_dcache_sb+0x212/0x2e7
[<78207308>] shrink_dcache_memory+0x13e/0x1b6
[<781cd543>] shrink_slab+0x146/0x1b8
[<781cf248>] kswapd+0x501/0x625
[<7815ac79>] kthread+0x84/0x8d
[<78103f57>] kernel_thread_helper+0x7/0x10
[<ffffffff>] 0xffffffff
INITIAL USE at:
[<78171677>] __lock_acquire+0x17e/0x102d
[<7817260e>] lock_acquire+0xe8/0x127
[<7849aca4>] _spin_lock+0x4d/0x8e
[<7820afe4>] ifind_fast+0x29/0xa4
[<7820b310>] iget_locked+0x3d/0x148
[<7824da34>] sysfs_get_inode+0x27/0x1e1
[<7825077e>] sysfs_fill_super+0x59/0xdb
[<781f7b30>] get_sb_single+0x9b/0xc0
[<7825070b>] sysfs_get_sb+0x2e/0x48
[<781f68af>] vfs_kern_mount+0x51/0xab
[<781f692f>] kern_mount_data+0x26/0x3c
[<78657314>] sysfs_init+0x8f/0xc8
[<78655e07>] mnt_init+0x97/0x1b0
[<786558ab>] vfs_caches_init+0xb1/0x155
[<78638b03>] start_kernel+0x319/0x40a
[<78638085>] __init_begin+0x85/0xb0
[<ffffffff>] 0xffffffff
}

...

stack backtrace:
Pid: 290, comm: kswapd0 Not tainted 2.6.31-scst-dbg #3
Call Trace:
[<78497768>] ? printk+0x28/0x40
[<7816f9e1>] print_irq_inversion_bug+0x123/0x13a
[<7816fd20>] check_usage_forwards+0x65/0xb0
[<7817056d>] mark_lock+0x18f/0x3b3
[<7816fcbb>] ? check_usage_forwards+0x0/0xb0
[<78171876>] __lock_acquire+0x37d/0x102d
[<7816ee05>] ? put_lock_stats+0x18/0x45
[<78170313>] ? lock_release_holdtime+0xaa/0x175
[<7826a6fa>] ? journal_start+0xd4/0x13a
[<7849e1ea>] ? sub_preempt_count+0x9a/0xd3
[<7849b42f>] ? _spin_unlock+0x3a/0x6d
[<7826a43a>] ? start_this_handle+0x313/0x41a
[<7826a6fa>] ? journal_start+0xd4/0x13a
[<7817260e>] lock_acquire+0xe8/0x127
[<7826a6fa>] ? journal_start+0xd4/0x13a
[<7826a725>] journal_start+0xff/0x13a
[<7826a6fa>] ? journal_start+0xd4/0x13a
[<78261d2e>] ext3_journal_start_sb+0x39/0x70
[<78256ffb>] ext3_ordered_writepage+0xb8/0x1dc
[<78170b60>] ? trace_hardirqs_on+0x19/0x2e
[<781ce157>] shrink_page_list+0x64a/0x7cb
[<781ce966>] shrink_zone+0x68e/0xa6f
[<7815fe6f>] ? up_read+0x29/0x5a
[<781cf341>] kswapd+0x5fa/0x625
[<781cc7ed>] ? isolate_pages_global+0x0/0x1fa
[<7815b03d>] ? autoremove_wake_function+0x0/0x5b
[<781ced47>] ? kswapd+0x0/0x625
[<7815ac79>] kthread+0x84/0x8d
[<7815abf5>] ? kthread+0x0/0x8d
[<78103f57>] kernel_thread_helper+0x7/0x10

Vlad

Attachment: jbd_handle.bz2
Description: application/bzip