All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gt: Report the currently active execlists request
@ 2020-01-17 10:13 Chris Wilson
  2020-01-17 10:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Chris Wilson @ 2020-01-17 10:13 UTC (permalink / raw)
  To: intel-gfx

Since commit 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy"), we
prune the engine->active.requests list prior to preemption, thus
removing the trace of the currently executing request. If that request
hangs rather than be preempted, we conclude that no active request was
on the GPU. Fortunately, this only impacts our debugging, and not our
means of hang detection or recovery.

References: 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 29 ++++++++++++++++++-----
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 06ff7695fa29..93878fd42a7a 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1643,7 +1643,7 @@ static bool match_ring(struct i915_request *rq)
 struct i915_request *
 intel_engine_find_active_request(struct intel_engine_cs *engine)
 {
-	struct i915_request *request, *active = NULL;
+	struct i915_request *rq, *active = NULL;
 
 	/*
 	 * We are called by the error capture, reset and to dump engine
@@ -1657,18 +1657,35 @@ intel_engine_find_active_request(struct intel_engine_cs *engine)
 	 * we only care about the snapshot of this moment.
 	 */
 	lockdep_assert_held(&engine->active.lock);
-	list_for_each_entry(request, &engine->active.requests, sched.link) {
-		if (i915_request_completed(request))
+
+	rcu_read_lock();
+	rq = execlists_active(&engine->execlists);
+	if (rq) {
+		struct intel_timeline *tl = rq->context->timeline;
+
+		list_for_each_entry_continue_reverse(rq, &tl->requests, link) {
+			if (i915_request_completed(rq))
+				break;
+
+			active = rq;
+		}
+	}
+	rcu_read_unlock();
+	if (active)
+		return active;
+
+	list_for_each_entry(rq, &engine->active.requests, sched.link) {
+		if (i915_request_completed(rq))
 			continue;
 
-		if (!i915_request_started(request))
+		if (!i915_request_started(rq))
 			continue;
 
 		/* More than one preemptible request may match! */
-		if (!match_ring(request))
+		if (!match_ring(rq))
 			continue;
 
-		active = request;
+		active = rq;
 		break;
 	}
 
-- 
2.25.0

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

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

end of thread, other threads:[~2020-01-20 14:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 10:13 [Intel-gfx] [PATCH] drm/i915/gt: Report the currently active execlists request Chris Wilson
2020-01-17 10:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2020-01-17 10:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-01-17 10:59 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-17 11:23 ` [Intel-gfx] [PATCH] " Mika Kuoppala
2020-01-17 11:28   ` Chris Wilson
2020-01-17 11:32 ` Chris Wilson
2020-01-17 11:39   ` Mika Kuoppala
2020-01-17 15:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Report the currently active execlists request (rev2) Patchwork
2020-01-17 16:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-01-17 16:07 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-20 14:17 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork

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.