====================================================== WARNING: possible circular locking dependency detected 4.19.0-rc2+ #1 Not tainted ------------------------------------------------------ kswapd0/1428 is trying to acquire lock: 0000000054247373 (sb_internal){.+.+}, at: sb_start_intwrite include/linux/fs.h:1613 [inline] 0000000054247373 (sb_internal){.+.+}, at: ext4_evict_inode+0x588/0x19b0 fs/ext4/inode.c:250 but task is already holding lock: 000000001b42de20 (fs_reclaim){+.+.}, at: __page_frag_cache_refill mm/page_alloc.c:4476 [inline] 000000001b42de20 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4505 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (fs_reclaim){+.+.}: __fs_reclaim_acquire mm/page_alloc.c:3728 [inline] fs_reclaim_acquire.part.98+0x24/0x30 mm/page_alloc.c:3739 fs_reclaim_acquire+0x14/0x20 mm/page_alloc.c:3740 slab_pre_alloc_hook mm/slab.h:418 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc_trace+0x2d/0x730 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] smk_fetch.part.24+0x5a/0xf0 security/smack/smack_lsm.c:273 smk_fetch security/smack/smack_lsm.c:3548 [inline] smack_d_instantiate+0x946/0xea0 security/smack/smack_lsm.c:3502 security_d_instantiate+0x5c/0xf0 security/security.c:1287 d_instantiate+0x5e/0xa0 fs/dcache.c:1870 shmem_mknod+0x189/0x1f0 mm/shmem.c:2812 vfs_mknod+0x447/0x800 fs/namei.c:3719 handle_create+0x1ff/0x7c0 drivers/base/devtmpfs.c:211 handle drivers/base/devtmpfs.c:374 [inline] devtmpfsd+0x27f/0x4c0 drivers/base/devtmpfs.c:400 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 -> #2 (&isp->smk_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0x171/0x1700 kernel/locking/mutex.c:1073 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088 smack_d_instantiate+0x130/0xea0 security/smack/smack_lsm.c:3369 security_d_instantiate+0x5c/0xf0 security/security.c:1287 d_instantiate_new+0x7e/0x160 fs/dcache.c:1889 ext4_add_nondir+0x81/0x90 fs/ext4/namei.c:2415 ext4_symlink+0x761/0x1170 fs/ext4/namei.c:3162 vfs_symlink+0x37a/0x5d0 fs/namei.c:4127 do_symlinkat+0x242/0x2d0 fs/namei.c:4154 __do_sys_symlink fs/namei.c:4173 [inline] __se_sys_symlink fs/namei.c:4171 [inline] __x64_sys_symlink+0x59/0x80 fs/namei.c:4171 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (jbd2_handle){++++}: start_this_handle+0x5c0/0x1260 fs/jbd2/transaction.c:385 jbd2__journal_start+0x3c9/0x9f0 fs/jbd2/transaction.c:439 __ext4_journal_start_sb+0x18d/0x590 fs/ext4/ext4_jbd2.c:81 ext4_sample_last_mounted fs/ext4/file.c:414 [inline] ext4_file_open+0x552/0x7b0 fs/ext4/file.c:439 do_dentry_open+0x499/0x1250 fs/open.c:771 vfs_open+0xa0/0xd0 fs/open.c:880 do_last fs/namei.c:3418 [inline] path_openat+0x130f/0x5340 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_open_execat+0x221/0x8e0 fs/exec.c:853 __do_execve_file.isra.35+0x1707/0x2460 fs/exec.c:1755 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (sb_internal){.+.+}: lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1387 sb_start_intwrite include/linux/fs.h:1613 [inline] ext4_evict_inode+0x588/0x19b0 fs/ext4/inode.c:250 evict+0x4ae/0x990 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x5fa/0xa00 fs/inode.c:1573 dentry_unlink_inode+0x461/0x5e0 fs/dcache.c:374 __dentry_kill+0x44c/0x7a0 fs/dcache.c:566 dentry_kill+0xc9/0x5a0 fs/dcache.c:685 shrink_dentry_list+0x36c/0x7c0 fs/dcache.c:1090 prune_dcache_sb+0x12f/0x1c0 fs/dcache.c:1171 super_cache_scan+0x270/0x480 fs/super.c:102 do_shrink_slab+0x4ba/0xbb0 mm/vmscan.c:536 shrink_slab_memcg mm/vmscan.c:601 [inline] shrink_slab+0x6fe/0x8c0 mm/vmscan.c:674 shrink_node+0x429/0x16a0 mm/vmscan.c:2735 kswapd_shrink_node mm/vmscan.c:3457 [inline] balance_pgdat+0x7ca/0x1010 mm/vmscan.c:3567 kswapd+0x82f/0x11e0 mm/vmscan.c:3789 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 other info that might help us debug this: Chain exists of: sb_internal --> &isp->smk_lock --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&isp->smk_lock); lock(fs_reclaim); lock(sb_internal); *** DEADLOCK *** 3 locks held by kswapd0/1428: #0: 000000001b42de20 (fs_reclaim){+.+.}, at: __page_frag_cache_refill mm/page_alloc.c:4476 [inline] #0: 000000001b42de20 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4505 #1: 00000000d2ddb5ab (shrinker_rwsem){++++}, at: shrink_slab_memcg mm/vmscan.c:578 [inline] #1: 00000000d2ddb5ab (shrinker_rwsem){++++}, at: shrink_slab+0x1d1/0x8c0 mm/vmscan.c:674 #2: 00000000ee259585 (&type->s_umount_key#28){++++}, at: trylock_super+0x22/0x110 fs/super.c:412 stack backtrace: CPU: 1 PID: 1428 Comm: kswapd0 Not tainted 4.19.0-rc2+ #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.34.cold.55+0x1bd/0x27d kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1862 [inline] check_prevs_add kernel/locking/lockdep.c:1975 [inline] validate_chain kernel/locking/lockdep.c:2416 [inline] __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3412 lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1387 sb_start_intwrite include/linux/fs.h:1613 [inline] ext4_evict_inode+0x588/0x19b0 fs/ext4/inode.c:250 evict+0x4ae/0x990 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x5fa/0xa00 fs/inode.c:1573 dentry_unlink_inode+0x461/0x5e0 fs/dcache.c:374 __dentry_kill+0x44c/0x7a0 fs/dcache.c:566 dentry_kill+0xc9/0x5a0 fs/dcache.c:685 shrink_dentry_list+0x36c/0x7c0 fs/dcache.c:1090 prune_dcache_sb+0x12f/0x1c0 fs/dcache.c:1171 super_cache_scan+0x270/0x480 fs/super.c:102 do_shrink_slab+0x4ba/0xbb0 mm/vmscan.c:536 shrink_slab_memcg mm/vmscan.c:601 [inline] shrink_slab+0x6fe/0x8c0 mm/vmscan.c:674 shrink_node+0x429/0x16a0 mm/vmscan.c:2735 kswapd_shrink_node mm/vmscan.c:3457 [inline] balance_pgdat+0x7ca/0x1010 mm/vmscan.c:3567 kswapd+0x82f/0x11e0 mm/vmscan.c:3789 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413