From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by kanga.kvack.org (Postfix) with ESMTP id 0E7E46B004D for ; Wed, 10 Sep 2014 18:42:52 -0400 (EDT) Received: by mail-qa0-f47.google.com with SMTP id x12so18020984qac.6 for ; Wed, 10 Sep 2014 15:42:51 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q4si20387137qar.15.2014.09.10.15.42.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Sep 2014 15:42:50 -0700 (PDT) Message-ID: <5410D3E7.2020804@redhat.com> Date: Wed, 10 Sep 2014 18:42:47 -0400 From: Prarit Bhargava MIME-Version: 1.0 Subject: lockdep warning when logging in via ssh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: hughd@google.com, "linux-mm@kvack.org" , Dave Chinner , Eric Sandeen I see this when I attempt to login via ssh. I do not see it if I login on the serial console. [ 201.054547] ====================================================== [ 201.082819] [ INFO: possible circular locking dependency detected ] [ 201.112071] 3.17.0-rc4+ #1 Not tainted [ 201.129705] ------------------------------------------------------- [ 201.158238] sshd/8554 is trying to acquire lock: [ 201.179054] (&isec->lock){+.+.+.}, at: [] inode_doinit_with_dentry+0xc5/0x670 [ 201.219847] [ 201.219847] but task is already holding lock: [ 201.247255] (&mm->mmap_sem){++++++}, at: [] vm_mmap_pgoff+0x8f/0xf0 [ 201.283640] [ 201.283640] which lock already depends on the new lock. [ 201.283640] [ 201.321218] [ 201.321218] the existing dependency chain (in reverse order) is: [ 201.356331] -> #2 (&mm->mmap_sem){++++++}: [ 201.377731] [] __lock_acquire+0x380/0xb50 [ 201.406027] [] lock_acquire+0x99/0x1d0 [ 201.432867] [] might_fault+0x8c/0xb0 [ 201.458823] [] filldir+0x91/0x120 [ 201.483514] [] xfs_dir2_block_getdents.isra.12+0x1be/0x220 [xfs] [ 201.521199] [] xfs_readdir+0x1a4/0x2a0 [xfs] [ 201.550249] [] xfs_file_readdir+0x2b/0x30 [xfs] [ 201.581293] [] iterate_dir+0xae/0x140 [ 201.607964] [] SyS_getdents+0x9d/0x130 [ 201.635824] [] system_call_fastpath+0x16/0x1b [ 201.665367] -> #1 (&xfs_dir_ilock_class){++++.+}: [ 201.687368] [] __lock_acquire+0x380/0xb50 [ 201.716063] [] lock_acquire+0x99/0x1d0 [ 201.743603] [] down_read_nested+0x57/0xa0 [ 201.771960] [] xfs_ilock+0x122/0x250 [xfs] [ 201.800555] [] xfs_ilock_attr_map_shared+0x34/0x40 [xfs] [ 201.834681] [] xfs_attr_get+0xc0/0x1b0 [xfs] [ 201.864877] [] xfs_xattr_get+0x3d/0x80 [xfs] [ 201.895005] [] generic_getxattr+0x4f/0x70 [ 201.923173] [] inode_doinit_with_dentry+0x172/0x670 [ 201.955329] [] sb_finish_set_opts+0xd8/0x270 [ 201.984446] [] selinux_set_mnt_opts+0x2cd/0x630 [ 202.015726] [] superblock_doinit+0x77/0xf0 [ 202.044073] [] delayed_superblock_init+0x10/0x20 [ 202.074967] [] iterate_supers+0xb2/0x110 [ 202.103173] [] selinux_complete_init+0x33/0x40 [ 202.133771] [] security_load_policy+0x103/0x620 [ 202.164131] [] sel_write_load+0xbb/0x780 [ 202.191891] [] vfs_write+0xba/0x1f0 [ 202.217918] [] SyS_write+0x58/0xd0 [ 202.243473] [] system_call_fastpath+0x16/0x1b [ 202.273205] -> #0 (&isec->lock){+.+.+.}: [ 202.292818] [] validate_chain.isra.43+0x10d9/0x1170 [ 202.324616] [] __lock_acquire+0x380/0xb50 [ 202.352176] [] lock_acquire+0x99/0x1d0 [ 202.379637] [] mutex_lock_nested+0x88/0x520 [ 202.408647] [] inode_doinit_with_dentry+0xc5/0x670 [ 202.440389] [] selinux_d_instantiate+0x1c/0x20 [ 202.470704] [] security_d_instantiate+0x1b/0x30 [ 202.501868] [] d_instantiate+0x50/0x70 [ 202.528664] [] __shmem_file_setup+0xef/0x1f0 [ 202.557658] [] shmem_zero_setup+0x28/0x70 [ 202.585826] [] mmap_region+0x522/0x610 [ 202.613190] [] do_mmap_pgoff+0x301/0x3d0 [ 202.641687] [] vm_mmap_pgoff+0xb0/0xf0 [ 202.668753] [] SyS_mmap_pgoff+0x116/0x290 [ 202.697026] [] SyS_mmap+0x22/0x30 [ 202.722424] [] system_call_fastpath+0x16/0x1b [ 202.751931] [ 202.751931] other info that might help us debug this: [ 202.751931] [ 202.788578] Chain exists of: &isec->lock --> &xfs_dir_ilock_class --> &mm->mmap_sem [ 202.824995] Possible unsafe locking scenario: [ 202.824995] [ 202.851334] CPU0 CPU1 [ 202.872186] ---- ---- [ 202.892929] lock(&mm->mmap_sem); [ 202.908542] lock(&xfs_dir_ilock_class); [ 202.938063] lock(&mm->mmap_sem); [ 202.964735] lock(&isec->lock); [ 202.979226] [ 202.979226] *** DEADLOCK *** [ 202.979226] [ 203.006150] 1 lock held by sshd/8554: [ 203.023836] #0: (&mm->mmap_sem){++++++}, at: [] vm_mmap_pgoff+0x8f/0xf0 [ 203.062439] [ 203.062439] stack backtrace: [ 203.082082] CPU: 1 PID: 8554 Comm: sshd Not tainted 3.17.0-rc4+ #1 [ 203.110336] Hardware name: HP ProLiant MicroServer Gen8, BIOS J06 08/24/2013 [ 203.143994] 0000000000000 00000000d8562903 ffff88006c333a58 ffffffff8171b358 [ 203.671383] ffffffff82accf70 ffff88006c333a98 ffffffff8171444a ffff88006c333ad0 [ 203.705097] ffff88003507b718 ffff88003507b718 0000000000000000 ffff88003507aa10 [ 203.738777] Call Trace: [ 203.749696] [] dump_stack+0x4d/0x66 [ 203.774113] [] print_circular_bug+0x1f9/0x207 [ 203.801532] [] validate_chain.isra.43+0x10d9/0x1170 [ 203.831325] [] __lock_acquire+0x380/0xb50 [ 203.857340] [] lock_acquire+0x99/0x1d0 [ 203.882653] [] ? inode_doinit_with_dentry+0xc5/0x670 [ 203.913148] [] mutex_lock_nested+0x88/0x520 [ 203.939761] [] ? inode_doinit_with_dentry+0xc5/0x670 [ 203.969908] [] ? inode_doinit_with_dentry+0xc5/0x670 [ 203.999854] [] ? native_sched_clock+0x35/0xa0 [ 204.029374] [] ? sched_clock+0x9/0x10 [ 204.053170] [] inode_doinit_with_dentry+0xc5/0x670 [ 204.181571] [] ? lock_release_holdtime.part.28+0xf/0x190 [ 204.213464] [] selinux_d_instantiate+0x1c/0x20 [ 204.241190] [] security_d_instantiate+0x1b/0x30 [ 204.269524] [] d_instantiate+0x50/0x70 [ 204.293826] [] __shmem_file_setup+0xef/0x1f0 [ 204.320845] [] shmem_zero_setup+0x28/0x70 [ 204.346843] [] mmap_region+0x522/0x610 [ 204.371943] [] do_mmap_pgoff+0x301/0x3d0 [ 204.398095] [] vm_mmap_pgoff+0xb0/0xf0 [ 204.422903] [] SyS_mmap_pgoff+0x116/0x290 [ 204.448487] [] ? trace_hardirqs_on+0xd/0x10 [ 204.475204] [] SyS_mmap+0x22/0x30 [ 204.498005] [] system_call_fastpath+0x16/0x1b [ 204.526495] [sched_delayed] sched: RT throttling activated According to Dave Chinner: "It's the shmem code that is broken - instantiating an inode while holding the mmap_sem inverts lock orders all over the place, especially in the security subsystem...." P. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org