Skip to contentSkip to conversation

drm/i915: Fix a race between vma / object destruction and unbinding

PATCH In review Thomas Hellström 4 participants 7 messages Jan 27, 2022 – Jan 29, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fix a race between vma / object destruction and unbinding

The vma destruction code was using an unlocked advisory check for drm_mm_node_allocated() to avoid racing with eviction code unbinding the vma.

This is very fragile and prohibits the dereference of non-refcounted pointers of dying vmas after a call to __i915_vma_unbind(). It also prohibits the dereference of vma->obj of refcounted pointers of dying vmas after a call to __i915_vma_unbind(), since even if a refcount is held on the vma, that won't guarantee that its backing object doesn't get destroyed.

So introduce an unbind under the vm mutex at object destroy time, removing all weak references of the vma and its object from the object vma list and from the vm bound list.

---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +6 -0
index 1a9e1f940a7d..e03e362d320b 100644
@@ -280,6 +280,12 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
 			GEM_BUG_ON(vma->obj != obj);
 			spin_unlock(&obj->vma.lock);
 
+			/* Verify that the vma is unbound under the vm mutex. */
+			mutex_lock(&vma->vm->mutex);
+			atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
+			__i915_vma_unbind(vma);
+			mutex_unlock(&vma->vm->mutex);
+
 			__i915_vma_put(vma);
 
 			spin_lock(&obj->vma.lock);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Op 27-01-2022 om 12:56 schreef Thomas Hellström:

Quoted 27 lines

The vma destruction code was using an unlocked advisory check for drm_mm_node_allocated() to avoid racing with eviction code unbinding the vma.

This is very fragile and prohibits the dereference of non-refcounted pointers of dying vmas after a call to __i915_vma_unbind(). It also prohibits the dereference of vma->obj of refcounted pointers of dying vmas after a call to __i915_vma_unbind(), since even if a refcount is held on the vma, that won't guarantee that its backing object doesn't get destroyed.

So introduce an unbind under the vm mutex at object destroy time, removing all weak references of the vma and its object from the object vma list and from the vm bound list.

---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
index 1a9e1f940a7d..e03e362d320b 100644
@@ -280,6 +280,12 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
 			GEM_BUG_ON(vma->obj != obj);
 			spin_unlock(&obj->vma.lock);

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj) · line 291

Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +6 -0
 
+			/* Verify that the vma is unbound under the vm mutex. */
+			mutex_lock(&vma->vm->mutex);
+			atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
+			__i915_vma_unbind(vma);
+			mutex_unlock(&vma->vm->mutex);
+
 			__i915_vma_put(vma);
 
 			spin_lock(&obj->vma.lock);
#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix a race between vma / object destruction and unbinding

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: drm/i915: Fix a race between vma / object destruction and unbinding
URL : https://patchwork.freedesktop.org/series/99418/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11150 -> Patchwork_22125
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/index.html

Participating hosts (45 -> 41)
------------------------------

Additional (1): fi-kbl-soraka
Missing (5): fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus

Known issues
------------

Here are the changes found in Patchwork_22125 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fence@basic-busy@bcs0:
- fi-kbl-soraka: NOTRUN -> [SKIP][1] ([fdo#109271]) +8 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@gem_exec_fence@[email protected]

* igt@gem_exec_suspend@basic-s3@smem:
- fi-skl-6600u: [PASS][2] -> [INCOMPLETE][3] ([i915#4547])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/fi-skl-6600u/igt@gem_exec_suspend@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-skl-6600u/igt@gem_exec_suspend@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@[email protected]

* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#4613]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@[email protected]

* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][6] ([i915#1886] / [i915#2291])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [PASS][7] -> [INCOMPLETE][8] ([i915#4785])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/fi-hsw-4770/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-hsw-4770/igt@i915_selftest@[email protected]

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-soraka: NOTRUN -> [SKIP][9] ([fdo#109271] / [fdo#111827]) +8 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
- fi-cfl-8109u: [PASS][10] -> [DMESG-WARN][11] ([i915#295]) +12 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/fi-cfl-8109u/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-cfl-8109u/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-kbl-soraka: NOTRUN -> [SKIP][12] ([fdo#109271] / [i915#533])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-kbl-soraka/igt@[email protected]

* igt@runner@aborted:
- fi-hsw-4770: NOTRUN -> [FAIL][13] ([fdo#109271] / [i915#1436] / [i915#4312])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/fi-hsw-4770/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s3@smem:
- {bat-rpls-1}: [INCOMPLETE][14] ([i915#4898]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/bat-rpls-1/igt@gem_exec_suspend@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/bat-rpls-1/igt@gem_exec_suspend@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2291]: https://gitlab.freedesktop.org/drm/intel/issues/2291
[i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4898]: https://gitlab.freedesktop.org/drm/intel/issues/4898
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533

Build changes
-------------

* Linux: CI_DRM_11150 -> Patchwork_22125

CI-20190529: 20190529
CI_DRM_11150: f8638aec69be385b36c5608ed2522de97ecc58cc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6336: ae2eb9e18bc58a4c45f28cfd80962938198dec3c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_22125: 069e37d836ed88d3b4748aced8e8c17caa93f987 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

069e37d836ed drm/i915: Fix a race between vma / object destruction and unbinding

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/index.html

#3 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Fix a race between vma / object destruction and unbinding

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: drm/i915: Fix a race between vma / object destruction and unbinding
URL : https://patchwork.freedesktop.org/series/99418/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11150_full -> Patchwork_22125_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_22125_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_22125_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_22125_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_frontbuffer_tracking@psr-slowdraw:
- shard-tglb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-tglb8/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-tglb6/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_22125_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_balancer@parallel-keep-in-fence:
- shard-iclb: [PASS][3] -> [SKIP][4] ([i915#4525])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb4/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb5/igt@[email protected]

* igt@gem_exec_capture@pi@rcs0:
- shard-skl: [PASS][5] -> [INCOMPLETE][6] ([i915#4547])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl10/igt@gem_exec_capture@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl4/igt@gem_exec_capture@[email protected]

* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-kbl: [PASS][7] -> [FAIL][8] ([i915#2842]) +4 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-kbl6/igt@gem_exec_fair@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-kbl6/igt@gem_exec_fair@[email protected]
- shard-glk: NOTRUN -> [FAIL][9] ([i915#2842])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-iclb: [PASS][10] -> [FAIL][11] ([i915#2849])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb6/igt@gem_exec_fair@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_schedule@u-semaphore-user:
- shard-snb: NOTRUN -> [SKIP][12] ([fdo#109271]) +77 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-snb4/igt@[email protected]

* igt@gem_exec_whisper@basic-queues-priority-all:
- shard-glk: [PASS][13] -> [DMESG-WARN][14] ([i915#118])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-glk5/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk9/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- shard-iclb: NOTRUN -> [SKIP][15] ([i915#2190])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@[email protected]

* igt@gem_lmem_swapping@heavy-multi:
- shard-apl: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl3/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- shard-snb: [PASS][17] -> [INCOMPLETE][18] ([i915#3921])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-snb2/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-snb5/igt@i915_selftest@[email protected]

* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip:
- shard-iclb: NOTRUN -> [SKIP][19] ([fdo#110723])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html

* igt@kms_big_joiner@basic:
- shard-iclb: NOTRUN -> [SKIP][20] ([i915#2705])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@[email protected]

* igt@kms_ccs@pipe-a-crc-primary-rotation-180-y_tiled_gen12_rc_ccs:
- shard-glk: NOTRUN -> [SKIP][21] ([fdo#109271]) +16 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk3/igt@kms_ccs@pipe-a-crc-primary-rotation-180-y_tiled_gen12_rc_ccs.html

* igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_mc_ccs:
- shard-glk: NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#3886])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk3/igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_mc_ccs.html
- shard-apl: NOTRUN -> [SKIP][23] ([fdo#109271] / [i915#3886]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl3/igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_mc_ccs.html

* igt@kms_chamelium@dp-mode-timings:
- shard-apl: NOTRUN -> [SKIP][24] ([fdo#109271] / [fdo#111827]) +2 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl3/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-with-enabled-mode:
- shard-iclb: NOTRUN -> [SKIP][25] ([fdo#109284] / [fdo#111827])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@[email protected]

* igt@kms_color_chamelium@pipe-b-ctm-max:
- shard-snb: NOTRUN -> [SKIP][26] ([fdo#109271] / [fdo#111827]) +3 similar issues
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-snb4/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-snb: [PASS][27] -> [SKIP][28] ([fdo#109271])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-snb5/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-snb6/igt@[email protected]
- shard-skl: [PASS][29] -> [INCOMPLETE][30] ([i915#2828] / [i915#300])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl8/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl4/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-128x128-onscreen:
- shard-apl: NOTRUN -> [SKIP][31] ([fdo#109271]) +61 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl3/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-64x21-onscreen:
- shard-iclb: NOTRUN -> [SKIP][32] ([fdo#109278]) +3 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@b-edp1:
- shard-skl: [PASS][33] -> [FAIL][34] ([i915#79])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl4/igt@kms_flip@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl7/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
- shard-apl: [PASS][35] -> [DMESG-WARN][36] ([i915#180]) +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl2/igt@kms_flip@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl8/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check@b-edp1:
- shard-skl: [PASS][37] -> [FAIL][38] ([i915#2122])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl10/igt@kms_flip@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl4/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-mmap-wc:
- shard-iclb: NOTRUN -> [SKIP][39] ([fdo#109280]) +5 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-mmap-wc.html

* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [PASS][40] -> [FAIL][41] ([i915#1188]) +1 similar issue
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl10/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl4/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-d-frame-sequence:
- shard-apl: NOTRUN -> [SKIP][42] ([fdo#109271] / [i915#533])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl3/igt@[email protected]

* igt@kms_psr@psr2_basic:
- shard-iclb: [PASS][43] -> [SKIP][44] ([fdo#109441])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb2/igt@kms_psr@psr2_basic.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb3/igt@kms_psr@psr2_basic.html

* igt@perf@polling-small-buf:
- shard-skl: [PASS][45] -> [FAIL][46] ([i915#1722])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl4/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl10/igt@[email protected]

* igt@prime_nv_api@i915_nv_import_twice_check_flink_name:
- shard-iclb: NOTRUN -> [SKIP][47] ([fdo#109291])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@prime_nv_api@i915_nv_import_twice_check_flink_name.html

* igt@sysfs_clients@fair-0:
- shard-apl: NOTRUN -> [SKIP][48] ([fdo#109271] / [i915#2994])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl8/igt@[email protected]

#### Possible fixes ####

* igt@gem_eio@in-flight-contexts-1us:
- shard-tglb: [TIMEOUT][49] ([i915#3063]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-tglb8/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-tglb5/igt@[email protected]

* igt@gem_exec_balancer@parallel-keep-submit-fence:
- shard-iclb: [SKIP][51] ([i915#4525]) -> [PASS][52] +2 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb3/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb2/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-kbl: [FAIL][53] ([i915#2846]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-kbl1/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-kbl1/igt@[email protected]

* igt@gem_exec_fair@basic-none-vip@rcs0:
- shard-kbl: [FAIL][55] ([i915#2842]) -> [PASS][56] +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-kbl4/igt@gem_exec_fair@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-kbl1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none@vecs0:
- shard-apl: [FAIL][57] ([i915#2842]) -> [PASS][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl6/igt@gem_exec_fair@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl6/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@bcs0:
- shard-iclb: [FAIL][59] ([i915#2842]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb2/igt@gem_exec_fair@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-glk: [FAIL][61] ([i915#2842]) -> [PASS][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-glk6/igt@gem_exec_fair@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk5/igt@gem_exec_fair@[email protected]

* igt@gen9_exec_parse@allowed-all:
- shard-glk: [DMESG-WARN][63] ([i915#1436] / [i915#716]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-glk6/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk3/igt@[email protected]

* igt@i915_pm_dc@dc9-dpms:
- shard-iclb: [SKIP][65] ([i915#4281]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb3/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb8/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip:
- shard-skl: [FAIL][67] ([i915#2521]) -> [PASS][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl1/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl8/igt@[email protected]

* igt@kms_big_fb@linear-32bpp-rotate-180:
- shard-glk: [DMESG-WARN][69] ([i915#118]) -> [PASS][70] +1 similar issue
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-glk8/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk7/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-skl: [FAIL][71] ([i915#2346]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl1/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl8/igt@[email protected]

* igt@kms_flip@flip-vs-fences-interruptible@a-vga1:
- shard-snb: [INCOMPLETE][73] -> [PASS][74]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-snb4/igt@kms_flip@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-snb4/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-suspend@a-dp1:
- shard-apl: [DMESG-WARN][75] ([i915#180]) -> [PASS][76] +1 similar issue
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl3/igt@kms_flip@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl8/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-fb-recreate-interruptible@a-edp1:
- shard-skl: [FAIL][77] ([i915#2122]) -> [PASS][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl1/igt@kms_flip@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl8/igt@kms_flip@[email protected]

* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [SKIP][79] ([fdo#109441]) -> [PASS][80] +1 similar issue
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb1/igt@kms_psr@psr2_cursor_blt.html
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html

* igt@kms_setmode@basic:
- shard-glk: [FAIL][81] ([i915#31]) -> [PASS][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-glk4/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-glk8/igt@[email protected]

* igt@perf@polling-parameterized:
- shard-iclb: [FAIL][83] ([i915#1542]) -> [PASS][84]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb4/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@[email protected]
- shard-skl: [FAIL][85] ([i915#1542]) -> [PASS][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-skl8/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-skl6/igt@[email protected]

#### Warnings ####

* igt@i915_pm_rc6_residency@rc6-fence:
- shard-iclb: [WARN][87] ([i915#2684]) -> [WARN][88] ([i915#1804] / [i915#2684])
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb8/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb6/igt@[email protected]

* igt@i915_pm_rc6_residency@rc6-idle:
- shard-iclb: [WARN][89] ([i915#1804] / [i915#2684]) -> [WARN][90] ([i915#2684])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb3/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb8/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area:
- shard-iclb: [SKIP][91] ([fdo#111068] / [i915#658]) -> [SKIP][92] ([i915#2920])
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb3/igt@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb2/igt@[email protected]

* igt@kms_psr2_su@page_flip-p010:
- shard-iclb: [FAIL][93] ([i915#4148]) -> [SKIP][94] ([fdo#109642] / [fdo#111068] / [i915#658])
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-iclb2/igt@kms_psr2_su@page_flip-p010.html
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-iclb7/igt@kms_psr2_su@page_flip-p010.html

* igt@runner@aborted:
- shard-apl: ([FAIL][95], [FAIL][96], [FAIL][97], [FAIL][98], [FAIL][99]) ([fdo#109271] / [i915#180] / [i915#1814] / [i915#3002] / [i915#4312]) -> ([FAIL][100], [FAIL][101], [FAIL][102], [FAIL][103]) ([i915#180] / [i915#1814] / [i915#3002] / [i915#4312])
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl3/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl1/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl6/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl2/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11150/shard-apl1/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl2/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl6/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl1/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/shard-apl8/igt@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1722]: https://gitlab.freedesktop.org/drm/intel/issues/1722
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
[i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#2828]: https://gitlab.freedesktop.org/drm/intel/issues/2828
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2849]: https://gitlab.freedesktop.org/drm/intel/issues/2849
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#300]: https://gitlab.freedesktop.org/drm/intel/issues/300
[i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
[i915#3063]: https://gitlab.freedesktop.org/drm/intel/issues/3063
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4148]: https://gitlab.freedesktop.org/drm/intel/issues/4148
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79

Build changes
-------------

* Linux: CI_DRM_11150 -> Patchwork_22125

CI-20190529: 20190529
CI_DRM_11150: f8638aec69be385b36c5608ed2522de97ecc58cc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6336: ae2eb9e18bc58a4c45f28cfd80962938198dec3c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_22125: 069e37d836ed88d3b4748aced8e8c17caa93f987 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/index.html

#4 lore raw

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Fix a race between vma / object destruction and unbinding

Quoted 11 lines · Patchwork

Patch Details
Series:drm/i915: Fix a race between vma / object destruction and unbindingURL:
https://patchwork.freedesktop.org/series/99418/State:failure
Details:https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22125/index.html CI Bug Log - changes from CI_DRM_11150_full -> Patchwork_22125_fullSummaryFAILURE Serious unknown changes coming with Patchwork_22125_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_22125_full, please notify your bug team to

Quoted 8 lines

allow them
to document this new failure mode, which will reduce false positives in CI.
Participating hosts (10 -> 10)No changes in participating hosts Possible new issuesHere are the unknown changes that may have been introduced in Patchwork_22125_full:
IGT changesPossible regressions * igt@kms_frontbuffer_tracking@psr-slowdraw:
- shard-tglb: PASS -> INCOMPLETE

Unrelated failure.

/Thomas

#5 lore raw
In reply to Thomas Hellström
Quoted 11 lines · Thomas Hellström

The vma destruction code was using an unlocked advisory check for drm_mm_node_allocated() to avoid racing with eviction code unbinding the vma.

This is very fragile and prohibits the dereference of non-refcounted pointers of dying vmas after a call to __i915_vma_unbind(). It also prohibits the dereference of vma->obj of refcounted pointers of dying vmas after a call to __i915_vma_unbind(), since even if a refcount is held on the vma, that won't guarantee that its backing object doesn't get destroyed.

Quoted 3 lines

So introduce an unbind under the vm mutex at object destroy time, removing all weak references of the vma and its object from the object vma list and from the vm bound list.

Maarten suggested this fixes an oops like seen in https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22133/shard-snb6/igt@[email protected]. If that is so, what would be the Fixes: tag to put here? Although it is too late now so hopefully bug was introduced in something yet unreleased.

Quoted 10 lines
---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
index 1a9e1f940a7d..e03e362d320b 100644

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj) · line 287

Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +5 -0
@@ -280,6 +280,12 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
  			GEM_BUG_ON(vma->obj != obj);
  			spin_unlock(&obj->vma.lock);
 
+			/* Verify that the vma is unbound under the vm mutex. */
+			mutex_lock(&vma->vm->mutex);
+			atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
+			__i915_vma_unbind(vma);
+			mutex_unlock(&vma->vm->mutex);

Hm I am not up to speed with the latest design, but how does the verb verify and absence of conditionals reconcile here? Does the comment need improving?

Regards,

Tvrtko

Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -0
+
  			__i915_vma_put(vma);
 
  			spin_lock(&obj->vma.lock);
#6 lore raw
Quoted 13 lines · Tvrtko Ursulin
Quoted 11 lines · Thomas Hellström

The vma destruction code was using an unlocked advisory check for drm_mm_node_allocated() to avoid racing with eviction code unbinding the vma.

This is very fragile and prohibits the dereference of non-refcounted pointers of dying vmas after a call to __i915_vma_unbind(). It also prohibits the dereference of vma->obj of refcounted pointers of dying vmas after a call to __i915_vma_unbind(), since even if a refcount is held on the vma, that won't guarantee that its backing object doesn't get destroyed.

Quoted 5 lines
Quoted 3 lines

So introduce an unbind under the vm mutex at object destroy time, removing all weak references of the vma and its object from the object vma list and from the vm bound list.

Maarten suggested this fixes an oops like seen in https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22133/shard-snb6/igt@[email protected]. If that is so, what would be the Fixes: tag to put here? Although it is too late now so hopefully bug was introduced in something yet unreleased.

Yes, should've had a fixes tag here. Luckily it fixes a very recent commit, which shouldn't have had time to be released yet.

Quoted 6 lines
Quoted 6 lines

---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 6 ++++++

  1 file changed, 6 insertions(+)
Quoted 15 lines
Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
index 1a9e1f940a7d..e03e362d320b 100644
@@ -280,6 +280,12 @@ void __i915_gem_object_pages_fini(struct 
 drm_i915_gem_object *obj)
               GEM_BUG_ON(vma->obj != obj);
               spin_unlock(&obj->vma.lock);
Quoted 5 lines

  +            /* Verify that the vma is unbound under the vm mutex. */ +            mutex_lock(&vma->vm->mutex);
+            atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
+            __i915_vma_unbind(vma);
+            mutex_unlock(&vma->vm->mutex);

Hm I am not up to speed with the latest design, but how does the verb verify and absence of conditionals reconcile here? Does the comment need improving?

Yes. Ensure would have been better here. There is some rework of the vma destruction still needed, though so I'll update or remove the comment with those patches.

Thanks,

Thomas

Quoted 9 lines

Regards,

Tvrtko

Quoted 4 lines

+
              __i915_vma_put(vma);
                spin_lock(&obj->vma.lock);