All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/execlists: Don't trigger preemption if complete
@ 2018-05-01 10:46 Chris Wilson
  2018-05-01 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Chris Wilson @ 2018-05-01 10:46 UTC (permalink / raw)
  To: intel-gfx

Due to the latency of the tasklet running from ksoftirqd, by the time we
process the execlist dequeue may be a long time behind the GPU. If the
request was completed when we ran reschedule, we will not have tweaked
its priority, but if it is still listed as being in-flight for dequeue
we will use it as a reference for the rest of the queue, including
requests from its own context which will now be at higher priority. This
can cause us to issue a preempt-to-idle request, even though the request
we want to preempt is already complete.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index c6464336963e..d344fbe17997 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -610,7 +610,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 		if (!execlists_is_active(execlists, EXECLISTS_ACTIVE_HWACK))
 			goto unlock;
 
-		if (need_preempt(engine, last, execlists->queue_priority)) {
+		if (need_preempt(engine, last, execlists->queue_priority) &&
+		    !i915_request_completed(last)) {
 			inject_preempt_context(engine);
 			goto unlock;
 		}
-- 
2.17.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/execlists: Don't trigger preemption if complete
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
@ 2018-05-01 11:09 ` Patchwork
  2018-05-01 12:21 ` [PATCH v2] " Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-05-01 11:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/execlists: Don't trigger preemption if complete
URL   : https://patchwork.freedesktop.org/series/42515/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4116 -> Patchwork_8856 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/42515/revisions/1/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         PASS -> FAIL (fdo#102575)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-ivb-3520m:       DMESG-WARN (fdo#106084) -> PASS
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084


== Participating hosts (38 -> 35) ==

  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4116 -> Patchwork_8856

  CI_DRM_4116: 7ff375cb94000d93f7a9d541cb0c8180fbea80f2 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4453: 29ae12bd764e3b1876356e7628a32192b4ec9066 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8856: 8eeceef247da5f6855bd89b0ab8caaa18a6ddbeb @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4453: d0a0bca2194a673c4d9a70a2256837c59213c64b @ git://anongit.freedesktop.org/piglit


== Linux commits ==

8eeceef247da drm/i915/execlists: Don't trigger preemption if complete

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8856/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] drm/i915/execlists: Don't trigger preemption if complete
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
  2018-05-01 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-05-01 12:21 ` Chris Wilson
  2018-05-01 12:45 ` ✗ Fi.CI.IGT: failure for " Patchwork
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2018-05-01 12:21 UTC (permalink / raw)
  To: intel-gfx

Due to the latency of the tasklet running from ksoftirqd, by the time we
process the execlist dequeue may be a long time behind the GPU. If the
request was completed when we ran reschedule, we will not have tweaked
its priority, but if it is still listed as being in-flight for dequeue
we will use it as a reference for the rest of the queue, including
requests from its own context which will now be at higher priority. This
can cause us to issue a preempt-to-idle request, even though the request
we want to preempt is already complete.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index e627bdfb7aa6..57396a2a6ea2 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -185,7 +185,8 @@ static inline bool need_preempt(const struct intel_engine_cs *engine,
 				int prio)
 {
 	return (intel_engine_has_preemption(engine) &&
-		__execlists_need_preempt(prio, rq_prio(last)));
+		__execlists_need_preempt(prio, rq_prio(last)) &&
+		!i915_request_completed(last));
 }
 
 /**
-- 
2.17.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✗ Fi.CI.IGT: failure for drm/i915/execlists: Don't trigger preemption if complete
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
  2018-05-01 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-05-01 12:21 ` [PATCH v2] " Chris Wilson
@ 2018-05-01 12:45 ` Patchwork
  2018-05-01 12:47 ` ✓ Fi.CI.BAT: success for drm/i915/execlists: Don't trigger preemption if complete (rev2) Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-05-01 12:45 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/execlists: Don't trigger preemption if complete
URL   : https://patchwork.freedesktop.org/series/42515/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4116_full -> Patchwork_8856_full =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_8856_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_8856_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/42515/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-glk:          PASS -> INCOMPLETE

    
    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd2:
      shard-kbl:          SKIP -> PASS

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite:
      shard-hsw:          PASS -> SKIP

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_cursor_crc@cursor-128x128-suspend:
      shard-apl:          PASS -> FAIL (fdo#103375)

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_flip@flip-vs-expired-vblank:
      shard-glk:          PASS -> FAIL (fdo#102887, fdo#105363)

    igt@kms_flip@flip-vs-wf_vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip@wf_vblank-ts-check-interruptible:
      shard-apl:          PASS -> FAIL (fdo#100368)

    igt@kms_frontbuffer_tracking@fbc-rgb565-draw-mmap-cpu:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@kms_flip@2x-plain-flip-ts-check:
      shard-hsw:          FAIL (fdo#103928) -> PASS

    igt@kms_flip@flip-vs-blocking-wf-vblank:
      shard-kbl:          DMESG-FAIL (fdo#103558) -> PASS +1

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@modeset-vs-vblank-race-interruptible:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#103313, fdo#105602) -> PASS

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS +2

    igt@kms_flip_event_leak:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +33

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (9 -> 7) ==

  Missing    (2): pig-glk-j4005 shard-glkb 


== Build changes ==

    * Linux: CI_DRM_4116 -> Patchwork_8856

  CI_DRM_4116: 7ff375cb94000d93f7a9d541cb0c8180fbea80f2 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4453: 29ae12bd764e3b1876356e7628a32192b4ec9066 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8856: 8eeceef247da5f6855bd89b0ab8caaa18a6ddbeb @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4453: d0a0bca2194a673c4d9a70a2256837c59213c64b @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8856/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/execlists: Don't trigger preemption if complete (rev2)
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
                   ` (2 preceding siblings ...)
  2018-05-01 12:45 ` ✗ Fi.CI.IGT: failure for " Patchwork
@ 2018-05-01 12:47 ` Patchwork
  2018-05-01 13:42 ` ✓ Fi.CI.IGT: " Patchwork
  2018-05-01 15:33 ` [PATCH] drm/i915/execlists: Don't trigger preemption if complete Tvrtko Ursulin
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-05-01 12:47 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/execlists: Don't trigger preemption if complete (rev2)
URL   : https://patchwork.freedesktop.org/series/42515/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4116 -> Patchwork_8857 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/42515/revisions/2/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         PASS -> FAIL (fdo#102575)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106235)

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      fi-cnl-psr:         PASS -> FAIL (fdo#103481)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cnl-psr:         PASS -> DMESG-WARN (fdo#104951)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-ivb-3520m:       PASS -> DMESG-WARN (fdo#106084)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-ivb-3520m:       DMESG-WARN (fdo#106084) -> PASS
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
  fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084
  fdo#106235 https://bugs.freedesktop.org/show_bug.cgi?id=106235


== Participating hosts (38 -> 35) ==

  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4116 -> Patchwork_8857

  CI_DRM_4116: 7ff375cb94000d93f7a9d541cb0c8180fbea80f2 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4453: 29ae12bd764e3b1876356e7628a32192b4ec9066 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8857: c202ab8e8f6d1267e922e41ba3f75a88d3fbb3f1 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4453: d0a0bca2194a673c4d9a70a2256837c59213c64b @ git://anongit.freedesktop.org/piglit


== Linux commits ==

c202ab8e8f6d drm/i915/execlists: Don't trigger preemption if complete

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8857/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/execlists: Don't trigger preemption if complete (rev2)
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
                   ` (3 preceding siblings ...)
  2018-05-01 12:47 ` ✓ Fi.CI.BAT: success for drm/i915/execlists: Don't trigger preemption if complete (rev2) Patchwork
@ 2018-05-01 13:42 ` Patchwork
  2018-05-01 15:33 ` [PATCH] drm/i915/execlists: Don't trigger preemption if complete Tvrtko Ursulin
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-05-01 13:42 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/execlists: Don't trigger preemption if complete (rev2)
URL   : https://patchwork.freedesktop.org/series/42515/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4116_full -> Patchwork_8857_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_8857_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_8857_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/42515/revisions/2/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd1:
      shard-kbl:          PASS -> SKIP

    igt@gem_exec_schedule@deep-bsd2:
      shard-kbl:          SKIP -> PASS

    igt@kms_frontbuffer_tracking@fbc-rgb565-draw-blt:
      shard-snb:          PASS -> SKIP

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          PASS -> FAIL (fdo#102887)

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#105707)

    igt@kms_flip@flip-vs-wf_vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-mmap-wc:
      shard-hsw:          PASS -> DMESG-WARN (fdo#102614)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    igt@kms_vblank@pipe-a-accuracy-idle:
      shard-hsw:          PASS -> FAIL (fdo#102583)

    
    ==== Possible fixes ====

    igt@kms_flip@2x-plain-flip-ts-check:
      shard-hsw:          FAIL (fdo#103928) -> PASS

    igt@kms_flip@flip-vs-blocking-wf-vblank:
      shard-kbl:          DMESG-FAIL (fdo#103558) -> PASS +1

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@modeset-vs-vblank-race-interruptible:
      shard-kbl:          DMESG-WARN (fdo#105602, fdo#103558, fdo#103313) -> PASS

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS +2

    igt@kms_flip_event_leak:
      shard-kbl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +33

    igt@kms_sysfs_edid_timing:
      shard-apl:          WARN (fdo#100047) -> PASS

    
  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102583 https://bugs.freedesktop.org/show_bug.cgi?id=102583
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105707 https://bugs.freedesktop.org/show_bug.cgi?id=105707
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (9 -> 8) ==

  Missing    (1): shard-glkb 


== Build changes ==

    * Linux: CI_DRM_4116 -> Patchwork_8857

  CI_DRM_4116: 7ff375cb94000d93f7a9d541cb0c8180fbea80f2 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4453: 29ae12bd764e3b1876356e7628a32192b4ec9066 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8857: c202ab8e8f6d1267e922e41ba3f75a88d3fbb3f1 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4453: d0a0bca2194a673c4d9a70a2256837c59213c64b @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8857/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/execlists: Don't trigger preemption if complete
  2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
                   ` (4 preceding siblings ...)
  2018-05-01 13:42 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-05-01 15:33 ` Tvrtko Ursulin
  2018-05-01 20:24   ` Chris Wilson
  5 siblings, 1 reply; 8+ messages in thread
From: Tvrtko Ursulin @ 2018-05-01 15:33 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 01/05/2018 11:46, Chris Wilson wrote:
> Due to the latency of the tasklet running from ksoftirqd, by the time we
> process the execlist dequeue may be a long time behind the GPU. If the
> request was completed when we ran reschedule, we will not have tweaked
> its priority, but if it is still listed as being in-flight for dequeue
> we will use it as a reference for the rest of the queue, including
> requests from its own context which will now be at higher priority. This
> can cause us to issue a preempt-to-idle request, even though the request
> we want to preempt is already complete.
> 
> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index c6464336963e..d344fbe17997 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -610,7 +610,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   		if (!execlists_is_active(execlists, EXECLISTS_ACTIVE_HWACK))
>   			goto unlock;
>   
> -		if (need_preempt(engine, last, execlists->queue_priority)) {
> +		if (need_preempt(engine, last, execlists->queue_priority) &&
> +		    !i915_request_completed(last)) {
>   			inject_preempt_context(engine);
>   			goto unlock;
>   		}
> 

It makes sense on the most rudimentary level - don't preempt a context 
which is context saving itself.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/execlists: Don't trigger preemption if complete
  2018-05-01 15:33 ` [PATCH] drm/i915/execlists: Don't trigger preemption if complete Tvrtko Ursulin
@ 2018-05-01 20:24   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2018-05-01 20:24 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-05-01 16:33:15)
> 
> On 01/05/2018 11:46, Chris Wilson wrote:
> > Due to the latency of the tasklet running from ksoftirqd, by the time we
> > process the execlist dequeue may be a long time behind the GPU. If the
> > request was completed when we ran reschedule, we will not have tweaked
> > its priority, but if it is still listed as being in-flight for dequeue
> > we will use it as a reference for the rest of the queue, including
> > requests from its own context which will now be at higher priority. This
> > can cause us to issue a preempt-to-idle request, even though the request
> > we want to preempt is already complete.
> > 
> > Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   drivers/gpu/drm/i915/intel_lrc.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index c6464336963e..d344fbe17997 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -610,7 +610,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
> >               if (!execlists_is_active(execlists, EXECLISTS_ACTIVE_HWACK))
> >                       goto unlock;
> >   
> > -             if (need_preempt(engine, last, execlists->queue_priority)) {
> > +             if (need_preempt(engine, last, execlists->queue_priority) &&
> > +                 !i915_request_completed(last)) {
> >                       inject_preempt_context(engine);
> >                       goto unlock;
> >               }
> > 
> 
> It makes sense on the most rudimentary level - don't preempt a context 
> which is context saving itself.
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And picked up. To me the important connection is that when processing
the dependency tree we don't touch completed requests, so it should also
apply then during check of the inflight requests (as we may have skipped
them during rescheduling).

Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-01 20:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01 10:46 [PATCH] drm/i915/execlists: Don't trigger preemption if complete Chris Wilson
2018-05-01 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-05-01 12:21 ` [PATCH v2] " Chris Wilson
2018-05-01 12:45 ` ✗ Fi.CI.IGT: failure for " Patchwork
2018-05-01 12:47 ` ✓ Fi.CI.BAT: success for drm/i915/execlists: Don't trigger preemption if complete (rev2) Patchwork
2018-05-01 13:42 ` ✓ Fi.CI.IGT: " Patchwork
2018-05-01 15:33 ` [PATCH] drm/i915/execlists: Don't trigger preemption if complete Tvrtko Ursulin
2018-05-01 20:24   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.