igt@gem_userptr_blits@sync-unmap - dmesg-warn - WARNING: possible circular locking dependency detected, is trying to acquire lock at: i915_vma_unbind but task is already holding lock: at: unmap_vmas
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_522/fi-icl-guc/igt@gem_userptr_blits@sync-unmap.html
<4> [631.871946] ======================================================
<4> [631.871949] WARNING: possible circular locking dependency detected
<4> [631.871952] 5.7.0-g999bc17a2471df-drmtip_522+ #1 Tainted: G U
<4> [631.871954] ------------------------------------------------------
<4> [631.871957] gem_userptr_bli/1581 is trying to acquire lock:
<4> [631.871959] ffff88887cd26a00 (&vm->mutex/1){+.+.}-{3:3}, at: i915_vma_unbind+0x64/0x120 [i915]
<4> [631.872037]
but task is already holding lock:
<4> [631.872039] ffffffff8266e440 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}, at: unmap_vmas+0x0/0x150
<4> [631.872046]
which lock already depends on the new lock.
<4> [631.872049]
the existing dependency chain (in reverse order) is:
<4> [631.872052]
-> #2 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}:
<4> [631.872057] page_mkclean_one+0xe4/0x220
<4> [631.872060] rmap_walk_file+0x18e/0x3a0
<4> [631.872063] page_mkclean+0xb4/0xe0
<4> [631.872067] clear_page_dirty_for_io+0xd4/0x3a0
<4> [631.872070] mpage_submit_page+0x1a/0x70
<4> [631.872073] mpage_process_page_bufs+0xe7/0x110
<4> [631.872076] mpage_prepare_extent_to_map+0x223/0x370
<4> [631.872079] ext4_writepages+0x516/0x11c0
<4> [631.872082] do_writepages+0x46/0xe0
<4> [631.872085] __filemap_fdatawrite_range+0xc6/0x100
<4> [631.872088] file_write_and_wait_range+0x3c/0x90
<4> [631.872092] ext4_sync_file+0x1a4/0x4e0
<4> [631.872095] do_fsync+0x33/0x60
<4> [631.872098] __x64_sys_fsync+0xb/0x10
<4> [631.872101] do_syscall_64+0x4f/0x220
<4> [631.872105] entry_SYSCALL_64_after_hwframe+0x49/0xb3
<4> [631.872107]
-> #1 (&mapping->i_mmap_rwsem){++++}-{3:3}:
<4> [631.872111] down_write+0x33/0x70
<4> [631.872114] unmap_mapping_pages+0x48/0x130
<4> [631.872169] i915_vma_revoke_mmap.part.37+0x59/0x120 [i915]
<4> [631.872223] __i915_vma_evict+0x160/0x3e0 [i915]
<4> [631.872274] __i915_vma_unbind+0x59/0x110 [i915]
<4> [631.872323] i915_vma_unbind+0x70/0x120 [i915]
<4> [631.872371] i915_gem_object_ggtt_pin+0x1bb/0x320 [i915]
<4> [631.872416] vm_fault_gtt+0x467/0x990 [i915]
<4> [631.872420] __do_fault+0x45/0xf8
<4> [631.872423] __handle_mm_fault+0xc64/0x1290
<4> [631.872426] handle_mm_fault+0x154/0x340
<4> [631.872430] do_page_fault+0x39b/0x710
<4> [631.872433] page_fault+0x34/0x40
<4> [631.872434]
-> #0 (&vm->mutex/1){+.+.}-{3:3}:
<4> [631.872440] __lock_acquire+0x196f/0x1f50
<4> [631.872443] lock_acquire+0xb5/0x3b0
<4> [631.872445] __mutex_lock+0x9a/0x9c0
<4> [631.872491] i915_vma_unbind+0x64/0x120 [i915]
<4> [631.872537] i915_gem_object_unbind+0x1d0/0x410 [i915]
<4> [631.872581] userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
<4> [631.872585] __mmu_notifier_invalidate_range_start+0x13d/0x250
<4> [631.872589] unmap_vmas+0x13e/0x150
<4> [631.872591] unmap_region+0xa3/0x100
<4> [631.872593] __do_munmap+0x26d/0x490
<4> [631.872596] __vm_munmap+0x66/0xc0
<4> [631.872598] __x64_sys_munmap+0x12/0x20
<4> [631.872601] do_syscall_64+0x4f/0x220
<4> [631.872603] entry_SYSCALL_64_after_hwframe+0x49/0xb3
<4> [631.872606]
other info that might help us debug this:
<4> [631.872609] Chain exists of:
&vm->mutex/1 --> &mapping->i_mmap_rwsem --> mmu_notifier_invalidate_range_start
<4> [631.872615] Possible unsafe locking scenario:
<4> [631.872617] CPU0 CPU1
<4> [631.872619] ---- ----
<4> [631.872621] lock(mmu_notifier_invalidate_range_start);
<4> [631.872623] lock(&mapping->i_mmap_rwsem);
<4> [631.872626] lock(mmu_notifier_invalidate_range_start);
<4> [631.872630] lock(&vm->mutex/1);
<4> [631.872632]
*** DEADLOCK ***