igt@gem_pwrite@self - dmesg-warn - WARNING: possible circular locking dependency detected
https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5364/shard-snb6/igt@gem_pwrite@self.html
<6> [22.380017] [IGT] gem_pwrite: starting subtest self
<4> [22.417782]
<4> [22.417786] ======================================================
<4> [22.417789] WARNING: possible circular locking dependency detected
<4> [22.417792] 5.5.0-rc5-CI-CI_DRM_7719+ #1 Tainted: G U
<4> [22.417802] ------------------------------------------------------
<4> [22.417805] gem_pwrite/1161 is trying to acquire lock:
<4> [22.417808] ffff8881fe529b88 (&mapping->i_mmap_rwsem){++++}, at: unmap_mapping_pages+0x48/0x130
<4> [22.417815]
but task is already holding lock:
<4> [22.417818] ffff888214089580 (&vm->mutex){+.+.}, at: i915_vma_release+0xf1/0x220 [i915]
<4> [22.417879]
which lock already depends on the new lock.
<4> [22.417882]
the existing dependency chain (in reverse order) is:
<4> [22.417884]
-> #2 (&vm->mutex){+.+.}:
<4> [22.417890] __mutex_lock+0x9a/0x9c0
<4> [22.417931] i915_vma_unbind+0x31/0x60 [i915]
<4> [22.417971] i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [22.418010] userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
<4> [22.418016] __mmu_notifier_invalidate_range_start+0x148/0x250
<4> [22.418019] unmap_vmas+0x13e/0x150
<4> [22.418022] unmap_region+0xa3/0x100
<4> [22.418024] __do_munmap+0x26d/0x490
<4> [22.418027] __vm_munmap+0x66/0xc0
<4> [22.418030] __x64_sys_munmap+0x12/0x20
<4> [22.418033] do_syscall_64+0x4f/0x220
<4> [22.418036] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [22.418039]
-> #1 (mmu_notifier_invalidate_range_start){+.+.}:
<4> [22.418044] page_mkclean_one+0xda/0x210
<4> [22.418047] rmap_walk_file+0xff/0x260
<4> [22.418049] page_mkclean+0x9f/0xb0
<4> [22.418053] clear_page_dirty_for_io+0xa2/0x2f0
<4> [22.418057] mpage_submit_page+0x1a/0x70
<4> [22.418059] mpage_process_page_bufs+0xe7/0x110
<4> [22.418062] mpage_prepare_extent_to_map+0x1d2/0x2b0
<4> [22.418065] ext4_writepages+0x5ba/0x12b0
<4> [22.418068] do_writepages+0x46/0xe0
<4> [22.418071] __filemap_fdatawrite_range+0xc6/0x100
<4> [22.418074] file_write_and_wait_range+0x3c/0x90
<4> [22.418076] ext4_sync_file+0x1a4/0x540
<4> [22.418079] do_fsync+0x33/0x60
<4> [22.418081] __x64_sys_fsync+0xb/0x10
<4> [22.418084] do_syscall_64+0x4f/0x220
<4> [22.418087] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [22.418089]
-> #0 (&mapping->i_mmap_rwsem){++++}:
<4> [22.418095] __lock_acquire+0x1328/0x15d0
<4> [22.418097] lock_acquire+0xa7/0x1c0
<4> [22.418100] down_write+0x33/0x70
<4> [22.418103] unmap_mapping_pages+0x48/0x130
<4> [22.418143] i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
<4> [22.418183] __i915_vma_unbind.part.39+0x330/0x510 [i915]
<4> [22.418222] i915_vma_release+0x101/0x220 [i915]
<4> [22.418259] __i915_gem_free_objects+0xe9/0x4e0 [i915]
<4> [22.418297] i915_gem_create_ioctl+0x12/0x40 [i915]
<4> [22.418301] drm_ioctl_kernel+0xa7/0xf0
<4> [22.418304] drm_ioctl+0x2e1/0x390
<4> [22.418306] do_vfs_ioctl+0x9c/0x730
<4> [22.418309] ksys_ioctl+0x35/0x60
<4> [22.418311] __x64_sys_ioctl+0x11/0x20
<4> [22.418314] do_syscall_64+0x4f/0x220
<4> [22.418316] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [22.418319]
other info that might help us debug this:
<4> [22.418322] Chain exists of:
&mapping->i_mmap_rwsem --> mmu_notifier_invalidate_range_start --> &vm->mutex
<4> [22.418328] Possible unsafe locking scenario:
<4> [22.418331] CPU0 CPU1
<4> [22.418333] ---- ----
<4> [22.418335] lock(&vm->mutex);
<4> [22.418337] lock(mmu_notifier_invalidate_range_start);
<4> [22.418341] lock(&vm->mutex);
<4> [22.418343] lock(&mapping->i_mmap_rwsem);
<4> [22.418346]
*** DEADLOCK ***
<4> [22.418349] 1 lock held by gem_pwrite/1161:
<4> [22.418351] #0: ffff888214089580 (&vm->mutex){+.+.}, at: i915_vma_release+0xf1/0x220 [i915]
<4> [22.418392]
stack backtrace:
<4> [22.418396] CPU: 5 PID: 1161 Comm: gem_pwrite Tainted: G U 5.5.0-rc5-CI-CI_DRM_7719+ #1
<4> [22.418400] Hardware name: Dell Inc. XPS 8300 /0Y2MRG, BIOS A06 10/17/2011
<4> [22.418403] Call Trace:
<4> [22.418408] dump_stack+0x71/0x9b
<4> [22.418411] check_noncircular+0x19b/0x1c0
<4> [22.418415] ? __lock_acquire+0x1328/0x15d0
<4> [22.418418] __lock_acquire+0x1328/0x15d0
<4> [22.418420] ? lockdep_hardirqs_on+0xe3/0x1c0
<4> [22.418423] lock_acquire+0xa7/0x1c0
<4> [22.418426] ? unmap_mapping_pages+0x48/0x130
<4> [22.418430] down_write+0x33/0x70
<4> [22.418432] ? unmap_mapping_pages+0x48/0x130
<4> [22.418435] unmap_mapping_pages+0x48/0x130
<4> [22.418474] i915_vma_revoke_mmap.part.37+0x66/0x190 [i915]
<4> [22.418513] __i915_vma_unbind.part.39+0x330/0x510 [i915]
<4> [22.418552] i915_vma_release+0x101/0x220 [i915]
<4> [22.418589] __i915_gem_free_objects+0xe9/0x4e0 [i915]
<4> [22.418628] ? i915_gem_dumb_create+0xb0/0xb0 [i915]
<4> [22.418666] i915_gem_create_ioctl+0x12/0x40 [i915]
<4> [22.418670] drm_ioctl_kernel+0xa7/0xf0
<4> [22.418673] drm_ioctl+0x2e1/0x390
<4> [22.418711] ? i915_gem_dumb_create+0xb0/0xb0 [i915]
<4> [22.418714] ? __lock_acquire+0x460/0x15d0
<4> [22.418718] ? debug_object_active_state+0x15c/0x170
<4> [22.418722] do_vfs_ioctl+0x9c/0x730
<4> [22.418725] ? task_work_run+0x6e/0xb0
<4> [22.418728] ? _raw_spin_unlock_irq+0x1f/0x40
<4> [22.418730] ? lockdep_hardirqs_on+0xe3/0x1c0
<4> [22.418733] ksys_ioctl+0x35/0x60
<4> [22.418736] __x64_sys_ioctl+0x11/0x20
<4> [22.418738] do_syscall_64+0x4f/0x220
<4> [22.418741] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [22.418744] RIP: 0033:0x7f5744fc75d7
<4> [22.418747] Code: b3 66 90 48 8b 05 b1 48 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 81 48 2d 00 f7 d8 64 89 01 48
<4> [22.418753] RSP: 002b:00007ffcf2602268 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
<4> [22.418757] RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007f5744fc75d7
<4> [22.418760] RDX: 00007ffcf26022a0 RSI: 00000000c010645b RDI: 0000000000000005
<4> [22.418763] RBP: 00007ffcf26022a0 R08: 0000000000200000 R09: 0000000100000000
<4> [22.418767] R10: 0000000000000056 R11: 0000000000000246 R12: 00000000c010645b
<4> [22.418770] R13: 0000000000000005 R14: 0000000000000000 R15: 0000000000000000
<6> [22.443088] [IGT] gem_pwrite: exiting, ret=0