Few GEM tests - dmesg-warn - WARNING: possible circular locking dependency detected, is trying to acquire lock at: unmap_mapping_pages, but task is already holding lock at: i915_vma_release
https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5466/shard-hsw6/igt@gem_blits@basic.html
<6> [36.847494] Console: switching to colour dummy device 80x25
<6> [36.847570] [IGT] gem_blits: executing
<6> [36.892468] [IGT] gem_blits: starting subtest basic
<4> [36.896693]
<4> [36.896699] ======================================================
<4> [36.896704] WARNING: possible circular locking dependency detected
<4> [36.896710] 5.6.0-rc3-CI-CI_DRM_8004+ #1 Tainted: G U
<4> [36.896715] ------------------------------------------------------
<4> [36.896720] kworker/u16:3/204 is trying to acquire lock:
<4> [36.896725] ffff8883e708e598 (&mapping->i_mmap_rwsem){++++}, at: unmap_mapping_pages+0x48/0x130
<4> [36.896740]
but task is already holding lock:
<4> [36.896744] ffff8883ebc09578 (&vm->mutex){+.+.}, at: i915_vma_release+0xf1/0x220 [i915]
<4> [36.896886]
which lock already depends on the new lock.
<4> [36.896891]
the existing dependency chain (in reverse order) is:
<4> [36.896897]
-> #2 (&vm->mutex){+.+.}:
<4> [36.896906] __mutex_lock+0x9a/0x9c0
<4> [36.897013] i915_vma_unbind+0xae/0x110 [i915]
<4> [36.897115] i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [36.897218] userptr_mn_invalidate_range_start+0xdd/0x190 [i915]
<4> [36.897226] __mmu_notifier_invalidate_range_start+0x13d/0x250
<4> [36.897232] unmap_vmas+0x13e/0x150
<4> [36.897238] unmap_region+0xa3/0x100
<4> [36.897244] __do_munmap+0x26d/0x490
<4> [36.897250] __vm_munmap+0x66/0xc0
<4> [36.897256] __x64_sys_munmap+0x12/0x20
<4> [36.897263] do_syscall_64+0x4f/0x220
<4> [36.897270] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [36.897275]
-> #1 (mmu_notifier_invalidate_range_start){+.+.}:
<4> [36.897284] page_mkclean_one+0xe4/0x220
<4> [36.897289] rmap_walk_file+0x18e/0x3a0
<4> [36.897294] page_mkclean+0xb4/0xe0
<4> [36.897302] clear_page_dirty_for_io+0xd4/0x390
<4> [36.897312] mpage_submit_page+0x1a/0x70
<4> [36.897318] mpage_process_page_bufs+0xe7/0x110
<4> [36.897325] mpage_prepare_extent_to_map+0x223/0x370
<4> [36.897331] ext4_writepages+0x52a/0x11a0
<4> [36.897337] do_writepages+0x46/0xe0
<4> [36.897343] __filemap_fdatawrite_range+0xc6/0x100
<4> [36.897349] file_write_and_wait_range+0x3c/0x90
<4> [36.897355] ext4_sync_file+0x1a4/0x4e0
<4> [36.897362] do_fsync+0x33/0x60
<4> [36.897367] __x64_sys_fsync+0xb/0x10
<4> [36.897373] do_syscall_64+0x4f/0x220
<4> [36.897378] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [36.897387]
-> #0 (&mapping->i_mmap_rwsem){++++}:
<4> [36.897402] __lock_acquire+0x1328/0x15d0
<4> [36.897411] lock_acquire+0xa7/0x1c0
<4> [36.897420] down_write+0x33/0x70
<4> [36.897429] unmap_mapping_pages+0x48/0x130
<4> [36.897533] i915_vma_revoke_mmap.part.39+0x66/0x190 [i915]
<4> [36.897630] __i915_vma_unbind+0x497/0x530 [i915]
<4> [36.897726] i915_vma_release+0x101/0x220 [i915]
<4> [36.897812] __i915_gem_free_objects+0x113/0x550 [i915]
<4> [36.897820] process_one_work+0x260/0x600
<4> [36.897825] worker_thread+0x37/0x380
<4> [36.897830] kthread+0x119/0x130
<4> [36.897836] ret_from_fork+0x3a/0x50
<4> [36.897840]
other info that might help us debug this:
<4> [36.897846] Chain exists of:
&mapping->i_mmap_rwsem --> mmu_notifier_invalidate_range_start --> &vm->mutex
<4> [36.897857] Possible unsafe locking scenario:
<4> [36.897863] CPU0 CPU1
<4> [36.897867] ---- ----
<4> [36.897871] lock(&vm->mutex);
<4> [36.897875] lock(mmu_notifier_invalidate_range_start);
<4> [36.897881] lock(&vm->mutex);
<4> [36.897886] lock(&mapping->i_mmap_rwsem);
<4> [36.897891]
*** DEADLOCK ***