Skip to contentSkip to conversation

drm/i915: add schedule out notification of preempted but completed request

PATCH Superseded Weinan Li 4 participants 7 messages Feb 24, 2018 – Mar 5, 2018

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Weinan Li

author
#0 lore raw

PATCH v2 1/1 drm/i915: add schedule out notification of preempted but completed request

There is one corner case missing schedule out notification of the preempted request. The preempted request is just completed when preemption happen, then it will be canceled and won't be resubmitted later, GVT-g will lost the schedule out notification.

Here add schedule out notification if found the preempted request has been completed.

v2:
- refine description, add completed check and notification in execlists_cancel_port_requests. (Chris)

---
 drivers/gpu/drm/i915/intel_lrc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +7 -1
index e781c91..24a6e68 100644
@@ -657,10 +657,16 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 
 	while (num_ports-- && port_isset(port)) {
 		struct i915_request *rq = port_request(port);
+		unsigned int notify;
 
 		GEM_BUG_ON(!execlists->active);
 		intel_engine_context_out(rq->engine);
-		execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_PREEMPTED);
+
+		notify = INTEL_CONTEXT_SCHEDULE_PREEMPTED;
+		if (i915_request_completed(rq))
+			notify = INTEL_CONTEXT_SCHEDULE_OUT;
+		execlists_context_status_change(rq, notify);
+
 		i915_request_put(rq);
 
 		memset(port, 0, sizeof(*port));
Signature · 6 lines
1.9.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: add schedule out notification of preempted but completed request

== Series Details ==

== Series Details ==

Series: drm/i915: add schedule out notification of preempted but completed request
URL : https://patchwork.freedesktop.org/series/38903/
State : success

== Summary ==

Series 38903v1 drm/i915: add schedule out notification of preempted but completed request
https://patchwork.freedesktop.org/api/1.0/series/38903/revisions/1/mbox/

Test kms_chamelium:

        Subgroup dp-edid-read:
                fail       -> PASS       (fi-kbl-7500u) fdo#102505
Test kms_force_connector_basic:
        Subgroup force-connector-state:
                skip       -> PASS       (fi-snb-2520m)
        Subgroup force-edid:
                skip       -> PASS       (fi-snb-2520m)
        Subgroup force-load-detect:
                skip       -> PASS       (fi-snb-2520m)
        Subgroup prune-stale-modes:
                skip       -> PASS       (fi-snb-2520m)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (fi-bxt-dsi) fdo#103927

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:432s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:488s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:481s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:466s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:394s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:578s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:416s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:289s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:386s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:448s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:449s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:493s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:451s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:496s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:585s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:431s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:502s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:520s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:485s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:472s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:405s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:435s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:520s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:393s

316ba650abe6c1e8ac2f812ff21eee5771546ba1 drm-tip: 2018y-02m-23d-16h-41m-52s UTC integration manifest d9aa326c5adb drm/i915: add schedule out notification of preempted but completed request

== Logs ==

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

#2 lore raw

✓ Fi.CI.IGT: success for drm/i915: add schedule out notification of preempted but completed request

In reply to Weinan Li
== Series Details ==

== Series Details ==

Series: drm/i915: add schedule out notification of preempted but completed request
URL : https://patchwork.freedesktop.org/series/38903/
State : success

== Summary ==

Test kms_sysfs_edid_timing:

                pass       -> WARN       (shard-apl) fdo#100047
Test kms_cursor_crc:
        Subgroup cursor-256x256-suspend:
                pass       -> INCOMPLETE (shard-hsw) fdo#103375
        Subgroup cursor-64x64-suspend:
                pass       -> INCOMPLETE (shard-hsw) fdo#103540
Test kms_plane:
        Subgroup plane-position-hole-dpms-pipe-b-planes:
                fail       -> PASS       (shard-apl)
Test kms_chv_cursor_fail:
        Subgroup pipe-a-64x64-top-edge:
                fail       -> PASS       (shard-apl)
Test drv_suspend:
        Subgroup fence-restore-tiled2untiled:
                skip       -> PASS       (shard-hsw)
Test kms_flip:
        Subgroup plain-flip-ts-check-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

shard-apl        total:3563 pass:1870 dwarn:1   dfail:0   fail:14  skip:1677 time:12597s
shard-hsw        total:3292 pass:1673 dwarn:1   dfail:0   fail:3   skip:1612 time:10822s
shard-snb        total:3465 pass:1358 dwarn:1   dfail:0   fail:2   skip:2104 time:6636s

Blacklisted hosts:
shard-kbl total:3386 pass:1919 dwarn:1 dfail:0 fail:14 skip:1451 time:9302s

== Logs ==

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

#3 lore raw
In reply to Weinan Li

Any comments? This issue impact the preemption enabling in host, without the schedule out notification, vgpu will run into wrong state. Thanks
-Weinan

Quoted 53 lines

-----Original Message-----
From: Li, Weinan Z
Sent: Saturday, February 24, 2018 11:00 AM
To: [email protected]
Cc: [email protected]; Li, Weinan Z <[email protected]>; Chris Wilson <[email protected]>; Zhenyu Wang <[email protected]>
Subject: [PATCH v2] drm/i915: add schedule out notification of preempted but completed request

There is one corner case missing schedule out notification of the preempted request. The preempted request is just completed when preemption happen, then it will be canceled and won't be resubmitted later, GVT-g will lost the schedule out notification.

Here add schedule out notification if found the preempted request has been completed.

v2:
- refine description, add completed check and notification in execlists_cancel_port_requests. (Chris)

---
 drivers/gpu/drm/i915/intel_lrc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +7 -1
index e781c91..24a6e68 100644
@@ -657,10 +657,16 @@ static void execlists_dequeue(struct
 intel_engine_cs *engine)
 
 	while (num_ports-- && port_isset(port)) {
 		struct i915_request *rq = port_request(port);
+		unsigned int notify;
 
 		GEM_BUG_ON(!execlists->active);
 		intel_engine_context_out(rq->engine);
-		execlists_context_status_change(rq,
 INTEL_CONTEXT_SCHEDULE_PREEMPTED);
+
+		notify = INTEL_CONTEXT_SCHEDULE_PREEMPTED;
+		if (i915_request_completed(rq))
+			notify = INTEL_CONTEXT_SCHEDULE_OUT;
+		execlists_context_status_change(rq, notify);
+
 		i915_request_put(rq);
Quoted 3 lines

memset(port, 0, sizeof(*port));
--
1.9.1

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

#4 lore raw
In reply to Weinan Li
Quoted 32 lines · Weinan Li

There is one corner case missing schedule out notification of the preempted request. The preempted request is just completed when preemption happen, then it will be canceled and won't be resubmitted later, GVT-g will lost the schedule out notification.

Here add schedule out notification if found the preempted request has been completed.

v2:
- refine description, add completed check and notification in execlists_cancel_port_requests. (Chris)

---
  drivers/gpu/drm/i915/intel_lrc.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +1 -0
index e781c91..24a6e68 100644
@@ -657,10 +657,16 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 
  	while (num_ports-- && port_isset(port)) {
  		struct i915_request *rq = port_request(port);
+		unsigned int notify;
 
  		GEM_BUG_ON(!execlists->active);
  		intel_engine_context_out(rq->engine);

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 672

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +6 -1
-		execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_PREEMPTED);
+
+		notify = INTEL_CONTEXT_SCHEDULE_PREEMPTED;
+		if (i915_request_completed(rq))
+			notify = INTEL_CONTEXT_SCHEDULE_OUT;
+		execlists_context_status_change(rq, notify);
+
  		i915_request_put(rq);
 
  		memset(port, 0, sizeof(*port));

I hope seqno in HWS cannot change between execlists_cancel_port_requests and __unwind_incomplete_requests? Some sort of delay in memory transaction vs the interrupt? No idea, could be talking nonsense.

From style point of view I would probably simplify with an inline ternary conditional in execlists_context_status_change.

Regards,

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

#5 lore raw

Quoting Tvrtko Ursulin (2018-03-05 11:06:23)

Quoted 42 lines · Weinan Li
Quoted 40 lines

There is one corner case missing schedule out notification of the preempted request. The preempted request is just completed when preemption happen, then it will be canceled and won't be resubmitted later, GVT-g will lost the schedule out notification.

Here add schedule out notification if found the preempted request has been completed.

v2:
- refine description, add completed check and notification in execlists_cancel_port_requests. (Chris)

---
  drivers/gpu/drm/i915/intel_lrc.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +7 -1
index e781c91..24a6e68 100644
@@ -657,10 +657,16 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 
      while (num_ports-- && port_isset(port)) {
              struct i915_request *rq = port_request(port);
+             unsigned int notify;
 
              GEM_BUG_ON(!execlists->active);
              intel_engine_context_out(rq->engine);
-             execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_PREEMPTED);
+
+             notify = INTEL_CONTEXT_SCHEDULE_PREEMPTED;
+             if (i915_request_completed(rq))
+                     notify = INTEL_CONTEXT_SCHEDULE_OUT;
+             execlists_context_status_change(rq, notify);
+
              i915_request_put(rq);
 
Quoted 6 lines

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 672

Quoted 2 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
              memset(port, 0, sizeof(*port));

I hope seqno in HWS cannot change between execlists_cancel_port_requests and __unwind_incomplete_requests? Some sort of delay in memory transaction vs the interrupt? No idea, could be talking nonsense.

Not nonsense, just the type of nightmare I have (irq_seqno_barrier ahem). We have an assert following the completion event to try and detect this type of error, which thankfully hasn't fired during normal usage (so far, it has only tripped over our programming bugs). I fear iommu in this regard as well as that introduces random latency around memory transactions that we know breaks coherency wrt interrupts.

As far as this goes, we already rely on this being called under stable HWS, or else preemption/reset-recovery is fubar.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by
#6 lore raw
Quoted 57 lines · Chris Wilson

Quoting Tvrtko Ursulin (2018-03-05 11:06:23)

Quoted 42 lines · Weinan Li
Quoted 40 lines

There is one corner case missing schedule out notification of the preempted request. The preempted request is just completed when preemption happen, then it will be canceled and won't be resubmitted later, GVT-g will lost the schedule out notification.

Here add schedule out notification if found the preempted request has been completed.

v2:
- refine description, add completed check and notification in execlists_cancel_port_requests. (Chris)

---
   drivers/gpu/drm/i915/intel_lrc.c | 8 +++++++-
   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +7 -1
index e781c91..24a6e68 100644
@@ -657,10 +657,16 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 
       while (num_ports-- && port_isset(port)) {
               struct i915_request *rq = port_request(port);
+             unsigned int notify;
 
               GEM_BUG_ON(!execlists->active);
               intel_engine_context_out(rq->engine);
-             execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_PREEMPTED);
+
+             notify = INTEL_CONTEXT_SCHEDULE_PREEMPTED;
+             if (i915_request_completed(rq))
+                     notify = INTEL_CONTEXT_SCHEDULE_OUT;
+             execlists_context_status_change(rq, notify);
+
               i915_request_put(rq);
 
Quoted 6 lines

drivers/gpu/drm/i915/intel_lrc.c static void execlists_dequeue(struct intel_engine_cs *engine) · line 672

Quoted 2 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
               memset(port, 0, sizeof(*port));

I hope seqno in HWS cannot change between execlists_cancel_port_requests and __unwind_incomplete_requests? Some sort of delay in memory transaction vs the interrupt? No idea, could be talking nonsense.

Not nonsense, just the type of nightmare I have (irq_seqno_barrier ahem). We have an assert following the completion event to try and detect this type of error, which thankfully hasn't fired during normal usage (so far, it has only tripped over our programming bugs). I fear iommu in this regard as well as that introduces random latency around memory transactions that we know breaks coherency wrt interrupts.

Quoted 2 lines

As far as this goes, we already rely on this being called under stable HWS, or else preemption/reset-recovery is fubar.

Yes I agree, much deeper issues in that case. So not relevant for GVT.

I wanted to suggest one possible alternative, that execlists_cancel_port_requests could always emit INTEL_CONTEXT_SCHEDULE_PREEMPTED, and then __unwind_incomplete_requests could emit INTEL_CONTEXT_SCHEDULE_OUT, but that would probably complicate things for GVT by having to handle duplicate notifications with different status.

So with the local variable dropped in favour of a ternary conditional:

Or maybe even execlists_context_status_cancelled(rq) and the magic inside id?

Regards,

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