Skip to contentSkip to conversation

drm/i915/eb: Fix pagefault disabling in the first slowpath

PATCH Applied Daniel Vetter 5 participants 7 messages Jun 18, 2021 – Jun 21, 2021

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

PATCH 1/1 drm/i915/eb: Fix pagefault disabling in the first slowpath

In

commit ebc0808fa2da0548a78e715858024cb81cd732bc

Author: Chris Wilson <[email protected]>
Date:   Tue Oct 18 13:02:51 2016 +0100

drm/i915: Restrict pagefault disabling to just around copy_from_user()

we entirely missed that there's a slow path call to eb_relocate_entry (or i915_gem_execbuffer_relocate_entry as it was called back then) which was left fully wrapped by pagefault_disable/enable() calls. Previously any issues with blocking calls where handled by the following code:

	/* we can't wait for rendering with pagefaults disabled */
	if (pagefault_disabled() && !object_is_idle(obj))
		return -EFAULT;

Now at this point the prefaulting was still around, which means in normal applications it was very hard to hit this bug. No idea why the regressions in igts weren't caught.

Now this all changed big time with 2 patches merged closely together.

First

commit 2889caa9232109afc8881f29a2205abeb5709d0c

Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:19 2017 +0100

drm/i915: Eliminate lots of iterations over the execobjects array

removes the prefaulting from the first relocation path, pushing it into the first slowpath (of which this patch added a total of 3 escalation levels). This would have really quickly uncovered the above bug, were it not for immediate adding a duct-tape on top with

commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb

Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:24 2017 +0100

drm/i915: Async GPU relocation processing

by pushing all all the relocation patching to the gpu if the buffer was busy, which avoided all the possible blocking calls.

The entire slowpath was then furthermore ditched in

commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d

Author: Chris Wilson <[email protected]>
Date:   Wed Mar 11 16:03:10 2020 +0000

drm/i915/gem: Drop relocation slowpath

and resurrected in

commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871

Author: Maarten Lankhorst <[email protected]>
Date:   Wed Aug 19 16:08:43 2020 +0200

Revert "drm/i915/gem: Drop relocation slowpath".

but this did not further impact what's going on.

Since pagefault_disable/enable is an atomic section, any sleeping in there is prohibited, and we definitely do that without gpu relocations since we have to wait for the gpu usage to finish before we can patch up the relocations.

Cc Jon Bloomfield <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Thomas Hellström" <[email protected]>
Cc Matthew Auld <[email protected]>
Cc Lionel Landwerlin <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -2
index 6539b82dda54..7ff2fc3c0b2c 100644
@@ -2082,9 +2082,7 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb,
 
 	list_for_each_entry(ev, &eb->relocs, reloc_link) {
 		if (!have_copy) {
-			pagefault_disable();
 			err = eb_relocate_vma(eb, ev);
-			pagefault_enable();
 			if (err)
 				break;
 		} else {
Signature · 6 lines
2.32.0.rc2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/eb: Fix pagefault disabling in the first slowpath

== Series Details ==

== Series Details ==

Series: drm/i915/eb: Fix pagefault disabling in the first slowpath
URL : https://patchwork.freedesktop.org/series/91691/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
2a6b87403e3a drm/i915/eb: Fix pagefault disabling in the first slowpath
-:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit ebc0808fa2da ("drm/i915: Restrict pagefault disabling to just around copy_from_user()")'
#11: 
commit ebc0808fa2da0548a78e715858024cb81cd732bc

-:35: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 2889caa92321 ("drm/i915: Eliminate lots of iterations over the execobjects array")' #35:
commit 2889caa9232109afc8881f29a2205abeb5709d0c

-:46: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 7dd4f6729f92 ("drm/i915: Async GPU relocation processing")' #46:
commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb

-:52: WARNING:REPEATED_WORD: Possible repeated word: 'all' #52:
by pushing all all the relocation patching to the gpu if the buffer

-:57: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 7dc8f1143778 ("drm/i915/gem: Drop relocation slowpath")' #57:
commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d

-:65: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fd1500fcd442 ("Revert "drm/i915/gem: Drop relocation slowpath".")' #65:
commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871

-:103: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'

total: 5 errors, 2 warnings, 0 checks, 9 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/eb: Fix pagefault disabling in the first slowpath

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/i915/eb: Fix pagefault disabling in the first slowpath
URL : https://patchwork.freedesktop.org/series/91691/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10245 -> Patchwork_20416
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@semaphore:
- fi-bdw-5557u: NOTRUN -> [SKIP][1] ([fdo#109271]) +23 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/fi-bdw-5557u/igt@amdgpu/[email protected]

* igt@core_hotunplug@unbind-rebind:
- fi-bdw-5557u: NOTRUN -> [WARN][2] ([i915#2283])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/fi-bdw-5557u/igt@[email protected]

* igt@i915_selftest@live@execlists:
- fi-bsw-kefka: [PASS][3] -> [INCOMPLETE][4] ([i915#2782] / [i915#2940])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/fi-bsw-kefka/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/fi-bsw-kefka/igt@i915_selftest@[email protected]

* igt@runner@aborted:
- fi-kbl-soraka: NOTRUN -> [FAIL][5] ([i915#1569] / [i915#192] / [i915#193] / [i915#194] / [i915#2426] / [i915#3363])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/fi-kbl-soraka/igt@[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
[i915#1569]: https://gitlab.freedesktop.org/drm/intel/issues/1569
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#192]: https://gitlab.freedesktop.org/drm/intel/issues/192
[i915#193]: https://gitlab.freedesktop.org/drm/intel/issues/193
[i915#194]: https://gitlab.freedesktop.org/drm/intel/issues/194
[i915#2283]: https://gitlab.freedesktop.org/drm/intel/issues/2283
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363

Participating hosts (42 -> 37)
------------------------------

Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus

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

* Linux: CI_DRM_10245 -> Patchwork_20416

CI-20190529: 20190529
CI_DRM_10245: af01f33ecc8beaf7a511da13fafa9ba82b364291 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6113: 138a29e30277b1039e9934fca5c782dc1e7a9f99 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_20416: 2a6b87403e3abcd4c0265a3536494e5ef60d506b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

2a6b87403e3a drm/i915/eb: Fix pagefault disabling in the first slowpath

== Logs ==

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/eb: Fix pagefault disabling in the first slowpath

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/i915/eb: Fix pagefault disabling in the first slowpath
URL : https://patchwork.freedesktop.org/series/91691/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10245_full -> Patchwork_20416_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_persistence@legacy-engines-hostile-preempt:
- shard-snb: NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#1099]) +4 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb5/igt@[email protected]

* igt@gem_eio@in-flight-suspend:
- shard-kbl: [PASS][2] -> [DMESG-WARN][3] ([i915#180]) +1 similar issue
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl3/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl3/igt@[email protected]

* igt@gem_eio@unwedge-stress:
- shard-snb: NOTRUN -> [FAIL][4] ([i915#3354])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb5/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-apl: [PASS][5] -> [SKIP][6] ([fdo#109271])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl8/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][7] -> [FAIL][8] ([i915#2842])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-tglb3/igt@gem_exec_fair@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-tglb7/igt@gem_exec_fair@[email protected]
- shard-glk: [PASS][9] -> [FAIL][10] ([i915#2842]) +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-glk3/igt@gem_exec_fair@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-glk7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-wide-active@rcs0:
- shard-snb: NOTRUN -> [FAIL][11] ([i915#3633]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb2/igt@gem_exec_reloc@[email protected]

* igt@gem_pread@exhaustion:
- shard-apl: NOTRUN -> [WARN][12] ([i915#2658])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]
- shard-snb: NOTRUN -> [WARN][13] ([i915#2658])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb5/igt@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-snb: NOTRUN -> [FAIL][14] ([i915#2724])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb5/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][15] ([i915#3318])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][16] -> [FAIL][17] ([i915#454])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb5/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb8/igt@[email protected]

* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
- shard-apl: NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#1937])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@i915_pm_lpsp@[email protected]

* igt@i915_suspend@forcewake:
- shard-skl: [PASS][19] -> [INCOMPLETE][20] ([i915#146] / [i915#636])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl7/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl1/igt@[email protected]

* igt@kms_ccs@pipe-c-random-ccs-data:
- shard-snb: NOTRUN -> [SKIP][21] ([fdo#109271]) +261 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb2/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-blue-to-red:
- shard-snb: NOTRUN -> [SKIP][22] ([fdo#109271] / [fdo#111827]) +14 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-snb2/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-negative:
- shard-kbl: NOTRUN -> [SKIP][23] ([fdo#109271] / [fdo#111827]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@[email protected]

* igt@kms_color_chamelium@pipe-invalid-degamma-lut-sizes:
- shard-apl: NOTRUN -> [SKIP][24] ([fdo#109271] / [fdo#111827]) +18 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_content_protection@atomic-dpms:
- shard-apl: NOTRUN -> [TIMEOUT][25] ([i915#1319])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding:
- shard-skl: [PASS][26] -> [FAIL][27] ([i915#3444])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl7/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl6/igt@[email protected]

* igt@kms_cursor_legacy@pipe-d-torture-bo:
- shard-kbl: NOTRUN -> [SKIP][28] ([fdo#109271] / [i915#533])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@[email protected]

* igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl: [PASS][29] -> [INCOMPLETE][30] ([i915#155] / [i915#180] / [i915#636])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl7/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl3/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible@b-dp1:
- shard-apl: [PASS][31] -> [DMESG-WARN][32] ([i915#180])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl3/igt@kms_flip@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl3/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilercccs:
- shard-apl: NOTRUN -> [SKIP][33] ([fdo#109271] / [i915#2672])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl8/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-pwrite:
- shard-skl: [PASS][34] -> [FAIL][35] ([i915#2546] / [i915#49])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl2/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-pwrite.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl1/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-pwrite.html

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
- shard-skl: [PASS][36] -> [FAIL][37] ([i915#53])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl7/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl6/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-d:
- shard-apl: NOTRUN -> [SKIP][38] ([fdo#109271] / [i915#533]) +1 similar issue
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_plane@pixel-format-source-clamping@pipe-a-planes:
- shard-skl: [PASS][39] -> [DMESG-WARN][40] ([i915#1982])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl10/igt@kms_plane@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl4/igt@kms_plane@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
- shard-apl: NOTRUN -> [FAIL][41] ([fdo#108145] / [i915#265])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [PASS][42] -> [FAIL][43] ([fdo#108145] / [i915#265])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl7/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl6/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][44] ([i915#265]) +1 similar issue
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
- shard-apl: NOTRUN -> [SKIP][45] ([fdo#109271] / [i915#658]) +6 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-3:
- shard-kbl: NOTRUN -> [SKIP][46] ([fdo#109271] / [i915#658])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@[email protected]

* igt@kms_psr@cursor_plane_onoff:
- shard-kbl: NOTRUN -> [SKIP][47] ([fdo#109271]) +33 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@kms_psr@cursor_plane_onoff.html

* igt@kms_sysfs_edid_timing:
- shard-apl: NOTRUN -> [FAIL][48] ([IGT#2])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@kms_sysfs_edid_timing.html

* igt@kms_writeback@writeback-pixel-formats:
- shard-apl: NOTRUN -> [SKIP][49] ([fdo#109271] / [i915#2437])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@nouveau_crc@pipe-b-ctx-flip-skip-current-frame:
- shard-apl: NOTRUN -> [SKIP][50] ([fdo#109271]) +197 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@perf@blocking:
- shard-skl: [PASS][51] -> [FAIL][52] ([i915#1542]) +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl7/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl9/igt@[email protected]

* igt@perf@polling-small-buf:
- shard-skl: [PASS][53] -> [FAIL][54] ([i915#1722])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl5/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl7/igt@[email protected]

* igt@sysfs_clients@fair-1:
- shard-apl: NOTRUN -> [SKIP][55] ([fdo#109271] / [i915#2994]) +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl7/igt@[email protected]

* igt@sysfs_clients@fair-7:
- shard-kbl: NOTRUN -> [SKIP][56] ([fdo#109271] / [i915#2994])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@[email protected]

#### Possible fixes ####

* igt@gem_eio@unwedge-stress:
- shard-iclb: [TIMEOUT][57] ([i915#2369] / [i915#2481] / [i915#3070]) -> [PASS][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb8/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb1/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-glk: [FAIL][59] ([i915#2846]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-glk1/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-glk8/igt@[email protected]

* igt@gem_exec_fair@basic-flow@rcs0:
- shard-tglb: [FAIL][61] ([i915#2842]) -> [PASS][62] +2 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-tglb7/igt@gem_exec_fair@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-tglb3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-iclb: [FAIL][63] ([i915#2842]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb7/igt@gem_exec_fair@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vecs0:
- shard-kbl: [FAIL][65] ([i915#2842]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl2/igt@gem_exec_fair@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_whisper@basic-normal:
- shard-glk: [DMESG-WARN][67] ([i915#118] / [i915#95]) -> [PASS][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-glk6/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-glk1/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- shard-tglb: [SKIP][69] ([i915#2190]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-tglb6/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-tglb1/igt@[email protected]

* igt@gem_mmap_gtt@big-copy-xy:
- shard-glk: [FAIL][71] ([i915#307]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-glk9/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-glk3/igt@[email protected]

* igt@gem_mmap_gtt@cpuset-big-copy:
- shard-iclb: [FAIL][73] ([i915#2428]) -> [PASS][74]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb3/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb4/igt@[email protected]

* igt@kms_ccs@pipe-a-random-ccs-data:
- shard-iclb: [DMESG-WARN][75] ([i915#3219]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb1/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb2/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: [FAIL][77] ([i915#2346] / [i915#533]) -> [PASS][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl5/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_flip@flip-vs-suspend@b-dp1:
- shard-apl: [DMESG-WARN][79] ([i915#180]) -> [PASS][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl8/igt@kms_flip@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl2/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible@c-edp1:
- shard-skl: [FAIL][81] ([i915#2122]) -> [PASS][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl5/igt@kms_flip@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl9/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible@c-hdmi-a1:
- shard-glk: [FAIL][83] ([i915#2122]) -> [PASS][84]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-glk9/igt@kms_flip@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-glk3/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu:
- shard-skl: [FAIL][85] ([i915#49]) -> [PASS][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl1/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu.html
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl2/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu.html

* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-gtt:
- shard-iclb: [SKIP][87] ([i915#668]) -> [PASS][88] +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb1/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb2/igt@[email protected]

* igt@kms_plane@plane-position-hole-dpms@pipe-a-planes:
- shard-iclb: [FAIL][89] ([i915#2472]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb1/igt@kms_plane@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb2/igt@kms_plane@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][91] ([fdo#108145] / [i915#265]) -> [PASS][92] +1 similar issue
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-skl6/igt@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-skl5/igt@[email protected]

* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [SKIP][93] ([fdo#109441]) -> [PASS][94] +1 similar issue
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb4/igt@kms_psr@psr2_cursor_blt.html
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html

* igt@perf_pmu@rc6-suspend:
- shard-kbl: [DMESG-WARN][95] ([i915#180]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl3/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl6/igt@[email protected]

#### Warnings ####

* igt@i915_pm_rc6_residency@rc6-idle:
- shard-iclb: [WARN][97] ([i915#1804] / [i915#2684]) -> [WARN][98] ([i915#2684])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb3/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb1/igt@[email protected]

* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [SKIP][99] ([fdo#109349]) -> [DMESG-WARN][100] ([i915#1226])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb4/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb2/igt@[email protected]

* igt@kms_psr2_sf@plane-move-sf-dmg-area-2:
- shard-iclb: [SKIP][101] ([i915#2920]) -> [SKIP][102] ([i915#658]) +1 similar issue
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-iclb2/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-iclb5/igt@[email protected]

* igt@runner@aborted:
- shard-kbl: ([FAIL][103], [FAIL][104], [FAIL][105]) ([i915#2292] / [i915#3002] / [i915#3363]) -> ([FAIL][106], [FAIL][107], [FAIL][108], [FAIL][109]) ([i915#1436] / [i915#180] / [i915#1814] / [i915#3002] / [i915#3363] / [i915#92])
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl2/igt@[email protected]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl3/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-kbl4/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl4/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl3/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl3/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-kbl3/igt@[email protected]
- shard-apl: ([FAIL][110], [FAIL][111], [FAIL][112], [FAIL][113]) ([fdo#109271] / [i915#180] / [i915#3002] / [i915#3363]) -> ([FAIL][114], [FAIL][115], [FAIL][116], [FAIL][117]) ([i915#180] / [i915#3002] / [i915#3363])
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl3/igt@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl8/igt@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl8/igt@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10245/shard-apl7/igt@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl6/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl3/igt@[email protected]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl2/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20416/shard-apl3/igt@[email protected]

[IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1226]: https://gitlab.freedesktop.org/drm/intel/issues/1226
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[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#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2292]: https://gitlab.freedesktop.org/drm/intel/issues/2292
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
[i915#2428]: https://gitlab.freedesktop.org/drm/intel/issues/2428
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2472]: https://gitlab.freedesktop.org/drm/intel/issues/2472
[i915#2481]: https://gitlab.freedesktop.org/drm/intel/issues/2481
[i915#2546]: https://gitlab.freedesktop.org/drm/intel/issues/2546
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
[i915#2724]: https://gitlab.freedesktop.org/drm/intel/issues/2724
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
[i915#307]: https://gitlab.freedesktop.org/drm/intel/issues/307
[i915#3070]: https://gitlab.freedesktop.org/drm/intel/issues/3070
[i915#3219]: https://gitlab.freedesktop.org/drm/intel/issues/3219
[i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
[i915#3354]: https://gitlab.freedesktop.org/drm/intel/issues/3354
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#3444]: https://gitlab.freedesktop.org/drm/intel/issues/3444
[i915#3633]: https://gitlab.freedesktop.org/drm/intel/issues/3633
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#636]: https://gitlab.freedesktop.org/drm/intel/issues/636
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#668]: https://gitlab.freedesktop.org/drm/intel/issues/668
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

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

No changes in participating hosts

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

* Linux: CI_DRM_10245 -> Patchwork_20416

CI-20190529: 20190529
CI_DRM_10245: af01f33ecc8beaf7a511da13fafa9ba82b364291 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6113: 138a29e30277b1039e9934fca5c782dc1e7a9f99 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_20416: 2a6b87403e3abcd4c0265a3536494e5ef60d506b @ 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_20416/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#4 lore raw
In reply to Daniel Vetter
Quoted 60 lines · Daniel Vetter

In

commit ebc0808fa2da0548a78e715858024cb81cd732bc

Author: Chris Wilson <[email protected]>
Date:   Tue Oct 18 13:02:51 2016 +0100

drm/i915: Restrict pagefault disabling to just around copy_from_user()

we entirely missed that there's a slow path call to eb_relocate_entry (or i915_gem_execbuffer_relocate_entry as it was called back then) which was left fully wrapped by pagefault_disable/enable() calls. Previously any issues with blocking calls where handled by the following code:

	/* we can't wait for rendering with pagefaults disabled */
	if (pagefault_disabled() && !object_is_idle(obj))
		return -EFAULT;

Now at this point the prefaulting was still around, which means in normal applications it was very hard to hit this bug. No idea why the regressions in igts weren't caught.

Now this all changed big time with 2 patches merged closely together.

First

commit 2889caa9232109afc8881f29a2205abeb5709d0c

Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:19 2017 +0100

drm/i915: Eliminate lots of iterations over the execobjects array

removes the prefaulting from the first relocation path, pushing it into the first slowpath (of which this patch added a total of 3 escalation levels). This would have really quickly uncovered the above bug, were it not for immediate adding a duct-tape on top with

commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb

Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:24 2017 +0100

drm/i915: Async GPU relocation processing

by pushing all all the relocation patching to the gpu if the buffer was busy, which avoided all the possible blocking calls.

The entire slowpath was then furthermore ditched in

commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d

Author: Chris Wilson <[email protected]>
Date:   Wed Mar 11 16:03:10 2020 +0000

drm/i915/gem: Drop relocation slowpath

and resurrected in

commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871

Author: Maarten Lankhorst <[email protected]>
Date:   Wed Aug 19 16:08:43 2020 +0200
Quoted 8 lines

Revert "drm/i915/gem: Drop relocation slowpath".

but this did not further impact what's going on.

Since pagefault_disable/enable is an atomic section, any sleeping in there is prohibited, and we definitely do that without gpu relocations since we have to wait for the gpu usage to finish before we can patch up the relocations.

Why do we also need the __copy_from_user_inatomic in eb_relocate_vma()?

Quoted 22 lines
Cc Jon Bloomfield <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Thomas Hellström" <[email protected]>
Cc Matthew Auld <[email protected]>
Cc Lionel Landwerlin <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -0
index 6539b82dda54..7ff2fc3c0b2c 100644

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb, · line 2088

Quoted 9 lines
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -2
@@ -2082,9 +2082,7 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb,
 
  	list_for_each_entry(ev, &eb->relocs, reloc_link) {
  		if (!have_copy) {
-			pagefault_disable();
  			err = eb_relocate_vma(eb, ev);
-			pagefault_enable();
  			if (err)
  				break;
  		} else {

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by
#5 lore raw

Op 21-06-2021 om 11:33 schreef Matthew Auld:

Quoted 90 lines · Daniel Vetter
Quoted 60 lines

In

commit ebc0808fa2da0548a78e715858024cb81cd732bc
Author: Chris Wilson <[email protected]>
Date:   Tue Oct 18 13:02:51 2016 +0100

     drm/i915: Restrict pagefault disabling to just around copy_from_user()

we entirely missed that there's a slow path call to eb_relocate_entry (or i915_gem_execbuffer_relocate_entry as it was called back then) which was left fully wrapped by pagefault_disable/enable() calls. Previously any issues with blocking calls where handled by the following code:

    /* we can't wait for rendering with pagefaults disabled */ if (pagefault_disabled() && !object_is_idle(obj)) return -EFAULT;

Now at this point the prefaulting was still around, which means in normal applications it was very hard to hit this bug. No idea why the regressions in igts weren't caught.

Now this all changed big time with 2 patches merged closely together.

First

commit 2889caa9232109afc8881f29a2205abeb5709d0c
Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:19 2017 +0100

     drm/i915: Eliminate lots of iterations over the execobjects array

removes the prefaulting from the first relocation path, pushing it into the first slowpath (of which this patch added a total of 3 escalation levels). This would have really quickly uncovered the above bug, were it not for immediate adding a duct-tape on top with

commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb
Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:24 2017 +0100

     drm/i915: Async GPU relocation processing

by pushing all all the relocation patching to the gpu if the buffer was busy, which avoided all the possible blocking calls.

The entire slowpath was then furthermore ditched in

commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d
Author: Chris Wilson <[email protected]>
Date:   Wed Mar 11 16:03:10 2020 +0000

         drm/i915/gem: Drop relocation slowpath

and resurrected in

commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871
Author: Maarten Lankhorst <[email protected]> Date:   Wed Aug 19 16:08:43 2020 +0200

Quoted 8 lines

         Revert "drm/i915/gem: Drop relocation slowpath".

but this did not further impact what's going on.

Since pagefault_disable/enable is an atomic section, any sleeping in there is prohibited, and we definitely do that without gpu relocations since we have to wait for the gpu usage to finish before we can patch up the relocations.

Why do we also need the __copy_from_user_inatomic in eb_relocate_vma()?

Quoted 16 lines
Cc Jon Bloomfield <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Thomas Hellström" <[email protected]>
Cc Matthew Auld <[email protected]>
Cc Lionel Landwerlin <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Jason Ekstrand <[email protected]>

---
  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 --

  1 file changed, 2 deletions(-)
Quoted 14 lines
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -0
index 6539b82dda54..7ff2fc3c0b2c 100644

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb, · line 2088

Quoted 9 lines
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -2
@@ -2082,9 +2082,7 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb,
         list_for_each_entry(ev, &eb->relocs, reloc_link) {
           if (!have_copy) {
-            pagefault_disable();
               err = eb_relocate_vma(eb, ev);
-            pagefault_enable();
               if (err)
                   break;
           } else {
 
#6 lore raw
Quoted 91 lines · Maarten Lankhorst

Op 21-06-2021 om 11:33 schreef Matthew Auld:

Quoted 90 lines · Daniel Vetter
Quoted 60 lines

In

commit ebc0808fa2da0548a78e715858024cb81cd732bc
Author: Chris Wilson <[email protected]>
Date:   Tue Oct 18 13:02:51 2016 +0100

     drm/i915: Restrict pagefault disabling to just around copy_from_user()

we entirely missed that there's a slow path call to eb_relocate_entry (or i915_gem_execbuffer_relocate_entry as it was called back then) which was left fully wrapped by pagefault_disable/enable() calls. Previously any issues with blocking calls where handled by the following code:

    /* we can't wait for rendering with pagefaults disabled */ if (pagefault_disabled() && !object_is_idle(obj)) return -EFAULT;

Now at this point the prefaulting was still around, which means in normal applications it was very hard to hit this bug. No idea why the regressions in igts weren't caught.

Now this all changed big time with 2 patches merged closely together.

First

commit 2889caa9232109afc8881f29a2205abeb5709d0c
Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:19 2017 +0100

     drm/i915: Eliminate lots of iterations over the execobjects array

removes the prefaulting from the first relocation path, pushing it into the first slowpath (of which this patch added a total of 3 escalation levels). This would have really quickly uncovered the above bug, were it not for immediate adding a duct-tape on top with

commit 7dd4f6729f9243bd7046c6f04c107a456bda38eb
Author: Chris Wilson <[email protected]>
Date:   Fri Jun 16 15:05:24 2017 +0100

     drm/i915: Async GPU relocation processing

by pushing all all the relocation patching to the gpu if the buffer was busy, which avoided all the possible blocking calls.

The entire slowpath was then furthermore ditched in

commit 7dc8f1143778a35b190f9413f228b3cf28f67f8d
Author: Chris Wilson <[email protected]>
Date:   Wed Mar 11 16:03:10 2020 +0000

         drm/i915/gem: Drop relocation slowpath

and resurrected in

commit fd1500fcd4420eee06e2c7f3aa6067b78ac05871
Author: Maarten Lankhorst <[email protected]> Date:   Wed Aug 19 16:08:43 2020 +0200

Quoted 8 lines

         Revert "drm/i915/gem: Drop relocation slowpath".

but this did not further impact what's going on.

Since pagefault_disable/enable is an atomic section, any sleeping in there is prohibited, and we definitely do that without gpu relocations since we have to wait for the gpu usage to finish before we can patch up the relocations.

Why do we also need the __copy_from_user_inatomic in eb_relocate_vma()?

Quoted 16 lines
Cc Jon Bloomfield <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc "Thomas Hellström" <[email protected]>
Cc Matthew Auld <[email protected]>
Cc Lionel Landwerlin <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Jason Ekstrand <[email protected]>

---
  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 --

  1 file changed, 2 deletions(-)
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -0
index 6539b82dda54..7ff2fc3c0b2c 100644
@@ -2082,9 +2082,7 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb,
         list_for_each_entry(ev, &eb->relocs, reloc_link) {
Quoted 8 lines

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb,

Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 -2
           if (!have_copy) {
-            pagefault_disable();
               err = eb_relocate_vma(eb, ev);
-            pagefault_enable();
               if (err)
                   break;
           } else {
 

Pushed to drm-intel-gt-next, thanks to both of you for taking a look. -Daniel

Quoted 5 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx