Re: lockdep warnings - possible circular locking

From: Dave Young
Date: Tue Aug 30 2011 - 05:35:49 EST


On Tue, Aug 30, 2011 at 5:27 PM, Tao Ma <tm@xxxxxx> wrote:
> Hi Dave,
> On 08/30/2011 05:09 PM, Dave Young wrote:
>> Hi,
>>
>> I got following lockdep warnings, ext4 related?
> This is already reported by many guys. Ted has a fix for it.
> Please search the mail with subject
> [URGENT PATCH] ext4: fix potential deadlock in ext4_evict_inode()
>

Thanks for tell, will try

> Thanks
> Tao
>>
>> =======================================================
>> [11038.258992] [ INFO: possible circular locking dependency detected ]
>> [11038.258996] 3.1.0-rc3-00283-gc11a7e2 #264
>> [11038.258998] -------------------------------------------------------
>> [11038.259002] soffice.bin/3022 is trying to acquire lock:
>> [11038.259005] Â(&sb->s_type->i_mutex_key#4){+.+.+.}, at:
>> [<ffffffff811836d3>] ext4_evict_inode+0x4a/0x2ff
>> [11038.259019]
>> [11038.259020] but task is already holding lock:
>> [11038.259024] Â(&group->notification_mutex){+.+...}, at:
>> [<ffffffff8112f838>] fsnotify_flush_notify+0x22/0x115
>> [11038.259034]
>> [11038.259034] which lock already depends on the new lock.
>> [11038.259036]
>> [11038.259039]
>> [11038.259039] the existing dependency chain (in reverse order) is:
>> [11038.259043]
>> [11038.259044] -> #1 (&group->notification_mutex){+.+...}:
>> [11038.259051] Â Â Â Â[<ffffffff8106c21d>] lock_acquire+0xd9/0x105
>> [11038.259057] Â Â Â Â[<ffffffff81532ac2>] _raw_spin_lock+0x2c/0x38
>> [11038.259064] Â Â Â Â[<ffffffff810f72fa>] __slab_alloc+0x105/0x374
>> [11038.259070] Â Â Â Â[<ffffffff810f7fd6>] kmem_cache_alloc+0x82/0xf1
>> [11038.259075] Â Â Â Â[<ffffffff81112c34>] __d_alloc+0x24/0x16e
>> [11038.259081] Â Â Â Â[<ffffffff81112de9>] d_alloc+0x1c/0x7e
>> [11038.259086] Â Â Â Â[<ffffffff81112ead>] d_alloc_name+0x62/0x64
>> [11038.259092] Â Â Â Â[<ffffffff8115fb06>] devpts_pty_new+0x16a/0x207
>> [11038.259098] Â Â Â Â[<ffffffff813015b6>] ptmx_open+0xac/0x106
>> [11038.259104] Â Â Â Â[<ffffffff81103983>] chrdev_open+0x138/0x157
>> [11038.259110] Â Â Â Â[<ffffffff810fee11>] __dentry_open+0x1af/0x2bd
>> [11038.259116] Â Â Â Â[<ffffffff810fefd5>] nameidata_to_filp+0x53/0x62
>> [11038.259122] Â Â Â Â[<ffffffff8110c449>] do_last+0x491/0x590
>> [11038.259128] Â Â Â Â[<ffffffff8110c615>] path_openat+0xcd/0x345
>> [11038.259134] Â Â Â Â[<ffffffff8110c982>] do_filp_open+0x38/0x86
>> [11038.259139] Â Â Â Â[<ffffffff810feb1d>] do_sys_open+0x6c/0xf6
>> [11038.259145] Â Â Â Â[<ffffffff810febd0>] sys_open+0x1b/0x1d
>> [11038.259150] Â Â Â Â[<ffffffff81539b52>] system_call_fastpath+0x16/0x1b
>> [11038.259157]
>> [11038.259158] -> #0 (&sb->s_type->i_mutex_key#4){+.+.+.}:
>> [11038.259165] Â Â Â Â[<ffffffff8106ba31>] __lock_acquire+0xb78/0xe95
>> [11038.259172] Â Â Â Â[<ffffffff8106c21d>] lock_acquire+0xd9/0x105
>> [11038.259177] Â Â Â Â[<ffffffff81531c7a>] __mutex_lock_common+0x48/0x355
>> [11038.259183] Â Â Â Â[<ffffffff81532030>] mutex_lock_nested+0x26/0x2b
>> [11038.259188] Â Â Â Â[<ffffffff811836d3>] ext4_evict_inode+0x4a/0x2ff
>> [11038.259194] Â Â Â Â[<ffffffff81115133>] evict+0xa7/0x163
>> [11038.259199] Â Â Â Â[<ffffffff811153be>] iput+0x1cf/0x1d7
>> [11038.259204] Â Â Â Â[<ffffffff811130d5>] dentry_kill+0x174/0x192
>> [11038.259209] Â Â Â Â[<ffffffff81113a73>] dput+0x103/0x113
>> [11038.259214] Â Â Â Â[<ffffffff8110937c>] path_put+0x15/0x21
>> [11038.259220] Â Â Â Â[<ffffffff8112f6fe>] fsnotify_put_event+0x53/0x90
>> [11038.259230] Â Â Â Â[<ffffffff8112f8f7>] fsnotify_flush_notify+0xe1/0x115
>> [11038.259233] Â Â Â Â[<ffffffff8112fc27>]
>> fsnotify_final_destroy_group+0x11/0x2f
>> [11038.259236] Â Â Â Â[<ffffffff8112fc82>] fsnotify_put_group+0x3d/0x43
>> [11038.259239] Â Â Â Â[<ffffffff8113157b>] inotify_release+0x48/0x4e
>> [11038.259242] Â Â Â Â[<ffffffff81101721>] fput+0x10b/0x1a8
>> [11038.259245] Â Â Â Â[<ffffffff810fe98b>] filp_close+0x6d/0x78
>> [11038.259248] Â Â Â Â[<ffffffff8103cd4c>] put_files_struct+0xa9/0x141
>> [11038.259252] Â Â Â Â[<ffffffff8103ce2b>] exit_files+0x47/0x50
>> [11038.259254] Â Â Â Â[<ffffffff8103e7f7>] do_exit+0x281/0x7b1
>> [11038.259257] Â Â Â Â[<ffffffff8103eda6>] do_group_exit+0x7f/0xab
>> [11038.259260] Â Â Â Â[<ffffffff8103ede4>] sys_exit_group+0x12/0x16
>> [11038.259263] Â Â Â Â[<ffffffff81539b52>] system_call_fastpath+0x16/0x1b
>> [11038.259266]
>> [11038.259266] other info that might help us debug this:
>> [11038.259267]
>> [11038.259269] ÂPossible unsafe locking scenario:
>> [11038.259269]
>> [11038.259271] Â Â Â ÂCPU0 Â Â Â Â Â Â Â Â Â ÂCPU1
>> [11038.259272] Â Â Â Â---- Â Â Â Â Â Â Â Â Â Â----
>> [11038.259273] Â lock(&group->notification_mutex);
>> [11038.259276] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âlock(&sb->s_type->i_mutex_key);
>> [11038.259279] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âlock(&group->notification_mutex);
>> [11038.259282] Â lock(&sb->s_type->i_mutex_key);
>> [11038.259284]
>> [11038.259284] Â*** DEADLOCK ***
>> [11038.259285]
>> [11038.259287] 1 lock held by soffice.bin/3022:
>> [11038.259288] Â#0: Â(&group->notification_mutex){+.+...}, at:
>> [<ffffffff8112f838>] fsnotify_flush_notify+0x22/0x115
>> [11038.259294]
>> [11038.259294] stack backtrace:
>> [11038.259297] Pid: 3022, comm: soffice.bin Not tainted
>> 3.1.0-rc3-00283-gc11a7e2 #264
>> [11038.259299] Call Trace:
>> [11038.259302] Â[<ffffffff8106aea8>] print_circular_bug+0x20e/0x21f
>> [11038.259305] Â[<ffffffff8106ba31>] __lock_acquire+0xb78/0xe95
>> [11038.259309] Â[<ffffffff8106c21d>] lock_acquire+0xd9/0x105
>> [11038.259312] Â[<ffffffff811836d3>] ? ext4_evict_inode+0x4a/0x2ff
>> [11038.259315] Â[<ffffffff81531c7a>] __mutex_lock_common+0x48/0x355
>> [11038.259318] Â[<ffffffff811836d3>] ? ext4_evict_inode+0x4a/0x2ff
>> [11038.259321] Â[<ffffffff811836d3>] ? ext4_evict_inode+0x4a/0x2ff
>> [11038.259324] Â[<ffffffff81532030>] mutex_lock_nested+0x26/0x2b
>> [11038.259326] Â[<ffffffff811836d3>] ext4_evict_inode+0x4a/0x2ff
>> [11038.259329] Â[<ffffffff81115133>] evict+0xa7/0x163
>> [11038.259332] Â[<ffffffff811153be>] iput+0x1cf/0x1d7
>> [11038.259335] Â[<ffffffff811130d5>] dentry_kill+0x174/0x192
>> [11038.259338] Â[<ffffffff81113a73>] dput+0x103/0x113
>> [11038.259340] Â[<ffffffff8110937c>] path_put+0x15/0x21
>> [11038.259343] Â[<ffffffff8112f6fe>] fsnotify_put_event+0x53/0x90
>> [11038.259346] Â[<ffffffff8112f8f7>] fsnotify_flush_notify+0xe1/0x115
>> [11038.259349] Â[<ffffffff81531ade>] ? mutex_unlock+0x9/0xb
>> [11038.259352] Â[<ffffffff8112fc27>] fsnotify_final_destroy_group+0x11/0x2f
>> [11038.259355] Â[<ffffffff8112fc82>] fsnotify_put_group+0x3d/0x43
>> [11038.259357] Â[<ffffffff8113157b>] inotify_release+0x48/0x4e
>> [11038.259360] Â[<ffffffff81101721>] fput+0x10b/0x1a8
>> [11038.259363] Â[<ffffffff810fe98b>] filp_close+0x6d/0x78
>> [11038.259366] Â[<ffffffff8103cd4c>] put_files_struct+0xa9/0x141
>> [11038.259368] Â[<ffffffff8103ccc5>] ? put_files_struct+0x22/0x141
>> [11038.259372] Â[<ffffffff81291a55>] ? do_raw_spin_unlock+0x8f/0x96
>> [11038.259375] Â[<ffffffff8103ce2b>] exit_files+0x47/0x50
>> [11038.259378] Â[<ffffffff8103e7f7>] do_exit+0x281/0x7b1
>> [11038.259380] Â[<ffffffff8103eda6>] do_group_exit+0x7f/0xab
>> [11038.259383] Â[<ffffffff8103ede4>] sys_exit_group+0x12/0x16
>> [11038.259386] Â[<ffffffff81539b52>] system_call_fastpath+0x16/0x1b
>>
>
>



--
Regards
Yang RuiRui
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/