Skip to contentSkip to conversation

drm/i915: Truly bump ready tasks ahead of busywaits

PATCH In review Chris Wilson 2 participants 4 messages May 9, 2019 – May 10, 2019

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

PATCH 1/1 drm/i915: Truly bump ready tasks ahead of busywaits

In commit b7404c7ecb38 ("drm/i915: Bump ready tasks ahead of busywaits"), I tried cutting a corner in order to not install a signal for each of our dependencies, and only listened to requests on which we were intending to busywait. The compromise that was made was that instead of then being able to promite the request with a full NOSEMAPHORE like its non-busywaiting brethren, as we had not ensured we had cleared the semaphore chain, we settled for only using the NEWCLIENT boost. With an over saturated system with multiple NEWCLIENTS in flight at any time, this was found to be an inadequate promotion and left us with a much poorer scheduling order than prior to using semaphores.

The outcome of this patch, is that all requests have NOSEMAPHORE priority when they have no dependencies and are ready to run and not busywait, restoring the pre-semaphore ordering on saturated systems.

Fixes b7404c7ecb38 ("drm/i915: Bump ready tasks ahead of busywaits")
Cc Tvrtko Ursulin <[email protected]>
Cc Dmitry Rogozhkin <[email protected]>
Cc Dmitry Ermilov <[email protected]>
---
 drivers/gpu/drm/i915/i915_request.c | 31 +++++++++++------------------
 1 file changed, 12 insertions(+), 19 deletions(-)
drivers/gpu/drm/i915/i915_request.c +12 -19
index bed213148cbb..5569dff3887b 100644
@@ -569,18 +569,7 @@ semaphore_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
 
 	switch (state) {
 	case FENCE_COMPLETE:
-		/*
-		 * We only check a small portion of our dependencies
-		 * and so cannot guarantee that there remains no
-		 * semaphore chain across all. Instead of opting
-		 * for the full NOSEMAPHORE boost, we go for the
-		 * smaller (but still preempting) boost of
-		 * NEWCLIENT. This will be enough to boost over
-		 * a busywaiting request (as that cannot be
-		 * NEWCLIENT) without accidentally boosting
-		 * a busywait over real work elsewhere.
-		 */
-		i915_schedule_bump_priority(request, I915_PRIORITY_NEWCLIENT);
+		i915_schedule_bump_priority(request, I915_PRIORITY_NOSEMAPHORE);
 		break;
 
 	case FENCE_FREE:
@@ -846,12 +835,6 @@ emit_semaphore_wait(struct i915_request *to,
 	if (err < 0)
 		return err;
 
-	err = i915_sw_fence_await_dma_fence(&to->semaphore,
-					    &from->fence, 0,
-					    I915_FENCE_GFP);
-	if (err < 0)
-		return err;
-
 	/* Only submit our spinner after the signaler is running! */
 	err = i915_request_await_execution(to, from, gfp);
 	if (err)
@@ -917,8 +900,18 @@ i915_request_await_request(struct i915_request *to, struct i915_request *from)
 						    &from->fence, 0,
 						    I915_FENCE_GFP);
 	}
+	if (ret < 0)
+		return ret;
+
+	if (to->sched.flags & I915_SCHED_HAS_SEMAPHORE_CHAIN) {
+		ret = i915_sw_fence_await_dma_fence(&to->semaphore,
+						    &from->fence, 0,
+						    I915_FENCE_GFP);
+		if (ret < 0)
+			return ret;
+	}
 
-	return ret < 0 ? ret : 0;
+	return 0;
 }
 
 int
Signature · 6 lines
2.20.1

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

✓ Fi.CI.BAT: success for drm/i915: Truly bump ready tasks ahead of busywaits

== Series Details ==

== Series Details ==

Series: drm/i915: Truly bump ready tasks ahead of busywaits
URL : https://patchwork.freedesktop.org/series/60486/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6072 -> Patchwork_12999
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [PASS][1] -> [DMESG-WARN][2] ([fdo#102614])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/fi-hsw-peppy/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/fi-hsw-peppy/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s4-devices:
- fi-kbl-7500u: [DMESG-WARN][3] ([fdo#105128] / [fdo#107139]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/fi-kbl-7500u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/fi-kbl-7500u/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@live_hangcheck:
- fi-apl-guc: [INCOMPLETE][5] ([fdo#103927] / [fdo#110624]) -> [DMESG-FAIL][6] ([fdo#110620])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/fi-apl-guc/igt@i915_selftest@live_hangcheck.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/fi-apl-guc/igt@i915_selftest@live_hangcheck.html

* igt@runner@aborted:
- fi-apl-guc: [FAIL][7] ([fdo#110624]) -> [FAIL][8] ([fdo#110622])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/fi-apl-guc/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/fi-apl-guc/igt@[email protected]

[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105128]: https://bugs.freedesktop.org/show_bug.cgi?id=105128
[fdo#107139]: https://bugs.freedesktop.org/show_bug.cgi?id=107139
[fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620
[fdo#110622]: https://bugs.freedesktop.org/show_bug.cgi?id=110622
[fdo#110624]: https://bugs.freedesktop.org/show_bug.cgi?id=110624

Participating hosts (49 -> 42)
------------------------------

Additional (1): fi-blb-e6850
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-byt-clapper

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

* Linux: CI_DRM_6072 -> Patchwork_12999

CI_DRM_6072: 645586708589c3d2ac81114595e875cdfbbff385 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4976: b1d91d0228db999145405e529952ca49bab7f706 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12999: 89d3cc2d23fab7f8c2e8506199705efbd66ea032 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

89d3cc2d23fa drm/i915: Truly bump ready tasks ahead of busywaits

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Chris Wilson

Quoting Chris Wilson (2019-05-09 21:51:54)

Quoted 11 lines

In commit b7404c7ecb38 ("drm/i915: Bump ready tasks ahead of busywaits"), I tried cutting a corner in order to not install a signal for each of our dependencies, and only listened to requests on which we were intending to busywait. The compromise that was made was that instead of then being able to promite the request with a full NOSEMAPHORE like its non-busywaiting brethren, as we had not ensured we had cleared the semaphore chain, we settled for only using the NEWCLIENT boost. With an over saturated system with multiple NEWCLIENTS in flight at any time, this was found to be an inadequate promotion and left us with a much poorer scheduling order than prior to using semaphores.

Quoted 5 lines

The outcome of this patch, is that all requests have NOSEMAPHORE priority when they have no dependencies and are ready to run and not busywait, restoring the pre-semaphore ordering on saturated systems.

Fixes b7404c7ecb38 ("drm/i915: Bump ready tasks ahead of busywaits")
Fixes f9e9e9de58c7 ("drm/i915: Prioritise non-busywait semaphore workloads")
Quoted 4 lines
Cc Tvrtko Ursulin <[email protected]>
Cc Dmitry Rogozhkin <[email protected]>
Cc Dmitry Ermilov <[email protected]>

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

#3 lore raw

✓ Fi.CI.IGT: success for drm/i915: Truly bump ready tasks ahead of busywaits

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915: Truly bump ready tasks ahead of busywaits
URL : https://patchwork.freedesktop.org/series/60486/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6072_full -> Patchwork_12999_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_rpm@i2c:
- shard-iclb: [PASS][1] -> [DMESG-WARN][2] ([fdo#109982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb2/igt@[email protected]

* igt@i915_pm_rpm@system-suspend:
- shard-skl: [PASS][3] -> [INCOMPLETE][4] ([fdo#104108] / [fdo#107807])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl10/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl1/igt@[email protected]

* igt@i915_suspend@fence-restore-tiled2untiled:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-apl3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-apl6/igt@[email protected]

* igt@kms_color@pipe-a-ctm-0-5:
- shard-skl: [PASS][7] -> [FAIL][8] ([fdo#108682])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl10/igt@[email protected]

* igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
- shard-glk: [PASS][9] -> [FAIL][10] ([fdo#106509] / [fdo#107409])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-glk6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-glk1/igt@[email protected]

* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-hsw: [PASS][11] -> [FAIL][12] ([fdo#103355])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-hsw2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-hsw6/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl: [PASS][13] -> [FAIL][14] ([fdo#105363])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl7/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-skl: [PASS][15] -> [INCOMPLETE][16] ([fdo#109507])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-iclb: [PASS][17] -> [FAIL][18] ([fdo#103167]) +9 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][19] -> [FAIL][20] ([fdo#108145] / [fdo#110403])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl1/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl8/igt@[email protected]

* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [PASS][21] -> [FAIL][22] ([fdo#103166])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb7/igt@[email protected]

* igt@kms_psr@no_drrs:
- shard-iclb: [PASS][23] -> [FAIL][24] ([fdo#108341])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb6/igt@kms_psr@no_drrs.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb1/igt@kms_psr@no_drrs.html

* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [PASS][25] -> [SKIP][26] ([fdo#109441]) +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb6/igt@kms_psr@psr2_sprite_plane_move.html

#### Possible fixes ####

* igt@i915_suspend@debugfs-reader:
- shard-apl: [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +8 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-apl6/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-apl4/igt@[email protected]

* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-apl: [FAIL][29] ([fdo#103375]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-apl5/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-apl7/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-b-64x64-bottom-edge:
- shard-snb: [SKIP][31] ([fdo#109271] / [fdo#109278]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-snb7/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-snb6/igt@[email protected]

* igt@kms_flip@flip-vs-suspend:
- shard-kbl: [DMESG-WARN][33] ([fdo#108566]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-kbl1/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-kbl1/igt@[email protected]

* igt@kms_flip@plain-flip-fb-recreate-interruptible:
- shard-skl: [FAIL][35] ([fdo#100368]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-skl2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-skl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][37] ([fdo#103167]) -> [PASS][38] +4 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html

* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [SKIP][39] ([fdo#109441]) -> [PASS][40] +2 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-iclb3/igt@kms_psr@psr2_primary_page_flip.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html

* igt@perf@oa-exponents:
- shard-glk: [FAIL][41] ([fdo#105483]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-glk5/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-glk7/igt@[email protected]

#### Warnings ####

* igt@gem_exec_params@no-bsd:
- shard-hsw: [SKIP][43] ([fdo#109271]) -> [INCOMPLETE][44] ([fdo#103540])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6072/shard-hsw7/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12999/shard-hsw4/igt@[email protected]

[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105483]: https://bugs.freedesktop.org/show_bug.cgi?id=105483
[fdo#106509]: https://bugs.freedesktop.org/show_bug.cgi?id=106509
[fdo#107409]: https://bugs.freedesktop.org/show_bug.cgi?id=107409
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108682]: https://bugs.freedesktop.org/show_bug.cgi?id=108682
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109507]: https://bugs.freedesktop.org/show_bug.cgi?id=109507
[fdo#109982]: https://bugs.freedesktop.org/show_bug.cgi?id=109982
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403

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

No changes in participating hosts

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

* Linux: CI_DRM_6072 -> Patchwork_12999

CI_DRM_6072: 645586708589c3d2ac81114595e875cdfbbff385 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4976: b1d91d0228db999145405e529952ca49bab7f706 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12999: 89d3cc2d23fab7f8c2e8506199705efbd66ea032 @ 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_12999/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx