Skip to contentSkip to conversation

drm/i915: Include engine state on detecting a missed breadcrumb/seqno

PATCH Superseded Chris Wilson 2 participants 6 messages Nov 8, 2017 – Nov 9, 2017

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Include engine state on detecting a missed breadcrumb/seqno

Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.

Cc Mika Kuoppala <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 11 +++++------
 drivers/gpu/drm/i915/intel_engine_cs.c   |  6 ++++++
 2 files changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +5 -6
index 4de054f8c1ba..1e4d2978fb86 100644
@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void)
 
 static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
 {
-	DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n",
-			 engine->name, __builtin_return_address(0),
-			 yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
-					&engine->irq_posted)),
-			 intel_engine_get_seqno(engine),
-			 intel_engine_last_submit(engine));
+	struct drm_printer p = drm_debug_printer(__func__);
+
+	DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS\n",
+			 engine->name, __builtin_return_address(0));
+	intel_engine_dump(engine, &p);
 
 	set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
 }
drivers/gpu/drm/i915/intel_engine_cs.c +6 -0
index 6997306be0d2..f22dc452030f 100644
@@ -1835,6 +1835,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 	}
 	spin_unlock_irq(&b->rb_lock);
 
+	drm_printf(m, "IRQ? 0x%lx (breadcrumbs? %s) (execlists? %s)\n",
+		   engine->irq_posted,
+		   yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
+				  &engine->irq_posted)),
+		   yesno(test_bit(ENGINE_IRQ_EXECLIST,
+				  &engine->irq_posted)));
 	drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine)));
 	drm_printf(m, "\n");
 }
Signature · 6 lines
2.15.0

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

Quoting Chris Wilson (2017-11-08 10:07:46)

Quoted 20 lines

Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.

Cc Mika Kuoppala <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 11 +++++------
 drivers/gpu/drm/i915/intel_engine_cs.c   |  6 ++++++
 2 files changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +0 -1
index 4de054f8c1ba..1e4d2978fb86 100644
@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void)
 
 static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
 {
-       DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n",

drivers/gpu/drm/i915/intel_breadcrumbs.c static unsigned long wait_timeout(void) · line 71

Quoted 10 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c +5 -5
-                        engine->name, __builtin_return_address(0),
-                        yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
-                                       &engine->irq_posted)),
-                        intel_engine_get_seqno(engine),
-                        intel_engine_last_submit(engine));
+       struct drm_printer p = drm_debug_printer(__func__);
+
+       DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS\n",
+                        engine->name, __builtin_return_address(0));
+       intel_engine_dump(engine, &p);

Ugh, need to pass the fmt onto intel_engine_dump. Otherwise we end up with this odd mixture of DRM_DEBUG_DRIVER and pr_debug. Alternatively, we could make a drm_debug_driver_printer etc.

In this case, probably both.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Include engine state on detecting a missed breadcrumb/seqno

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915: Include engine state on detecting a missed breadcrumb/seqno
URL : https://patchwork.freedesktop.org/series/33407/
State : failure

== Summary ==

Series 33407 revision 1 was fully merged or fully failed: no git log

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

#3 lore raw

PATCH v2 1/1 drm/i915: Include engine state on detecting a missed breadcrumb/seqno

In reply to Chris Wilson

Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.

v2: Rearrange intel_engine_disarm_breadcrumbs() to avoid calling intel_engine_dump() under the rb spinlock (Mika) and to pretty-print the error state early so that we include the full list of waiters.

Cc Mika Kuoppala <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 24 +++++++++++++-----------
 drivers/gpu/drm/i915/intel_engine_cs.c   |  6 ++++++
 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +13 -11
index 43cf227a51c2..918641a7c3f3 100644
@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void)
 
 static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
 {
-	DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n",
-			 engine->name, __builtin_return_address(0),
-			 yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
-					&engine->irq_posted)),
-			 intel_engine_get_seqno(engine),
-			 intel_engine_last_submit(engine));
+	struct drm_printer p = drm_debug_printer(__func__);
+
+	DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS\n",
+			 engine->name, __builtin_return_address(0));
+	intel_engine_dump(engine, &p);
 
 	set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
 }
@@ -207,12 +206,16 @@ void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine)
 void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine)
 {
 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
-	struct intel_wait *wait, *n, *first;
+	struct intel_wait *wait, *n;
 
 	if (!b->irq_armed)
 		return;
 
-	/* We only disarm the irq when we are idle (all requests completed),
+	if (intel_engine_wakeup(engine) & ENGINE_WAKEUP_ASLEEP)
+		missed_breadcrumb(engine);
+
+	/*
+	 * We only disarm the irq when we are idle (all requests completed),
 	 * so if the bottom-half remains asleep, it missed the request
 	 * completion.
 	 */
@@ -220,15 +223,14 @@ void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine)
 	spin_lock_irq(&b->rb_lock);
 
 	spin_lock(&b->irq_lock);
-	first = fetch_and_zero(&b->irq_wait);
+	b->irq_wait = NULL;
 	if (b->irq_armed)
 		__intel_engine_disarm_breadcrumbs(engine);
 	spin_unlock(&b->irq_lock);
 
 	rbtree_postorder_for_each_entry_safe(wait, n, &b->waiters, node) {
 		RB_CLEAR_NODE(&wait->node);
-		if (wake_up_process(wait->tsk) && wait == first)
-			missed_breadcrumb(engine);
+		wake_up_process(wait->tsk);
 	}
 	b->waiters = RB_ROOT;
 
drivers/gpu/drm/i915/intel_engine_cs.c +6 -0
index 403cc4749008..1846c55afef5 100644
@@ -1878,6 +1878,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 	}
 	spin_unlock_irq(&b->rb_lock);
 
+	drm_printf(m, "IRQ? 0x%lx (breadcrumbs? %s) (execlists? %s)\n",
+		   engine->irq_posted,
+		   yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
+				  &engine->irq_posted)),
+		   yesno(test_bit(ENGINE_IRQ_EXECLIST,
+				  &engine->irq_posted)));
 	drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine)));
 	drm_printf(m, "\n");
 }
Signature · 6 lines
2.15.0

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

Quoting Chris Wilson (2017-11-09 11:39:58)

Quoted 46 lines

Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.

v2: Rearrange intel_engine_disarm_breadcrumbs() to avoid calling intel_engine_dump() under the rb spinlock (Mika) and to pretty-print the error state early so that we include the full list of waiters.

Cc Mika Kuoppala <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 24 +++++++++++++-----------
 drivers/gpu/drm/i915/intel_engine_cs.c   |  6 ++++++
 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +6 -7
index 43cf227a51c2..918641a7c3f3 100644
@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void)
 
 static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
 {
-       DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n",
-                        engine->name, __builtin_return_address(0),
-                        yesno(test_bit(ENGINE_IRQ_BREADCRUMB,
-                                       &engine->irq_posted)),
-                        intel_engine_get_seqno(engine),
-                        intel_engine_last_submit(engine));
+       struct drm_printer p = drm_debug_printer(__func__);
+
+       DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS\n",
+                        engine->name, __builtin_return_address(0));
+       intel_engine_dump(engine, &p);
 
        set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
 }
@@ -207,12 +206,16 @@ void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine)
 void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine)
 {
        struct intel_breadcrumbs *b = &engine->breadcrumbs;
-       struct intel_wait *wait, *n, *first;
+       struct intel_wait *wait, *n;
 
        if (!b->irq_armed)
                return;

drivers/gpu/drm/i915/intel_breadcrumbs.c void intel_engine_unpin_breadcrumbs_irq(struct intel_engine_cs *engine) · line 221

Quoted 10 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c +5 -1
 
-       /* We only disarm the irq when we are idle (all requests completed),
+       if (intel_engine_wakeup(engine) & ENGINE_WAKEUP_ASLEEP)
+               missed_breadcrumb(engine);
+
+       /*
+        * We only disarm the irq when we are idle (all requests completed),
         * so if the bottom-half remains asleep, it missed the request
         * completion.
         */

Ugh, that comment should be attached to the intel_engine_wakeup() -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.BAT: warning for drm/i915: Include engine state on detecting a missed breadcrumb/seqno (rev2)

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915: Include engine state on detecting a missed breadcrumb/seqno (rev2)
URL : https://patchwork.freedesktop.org/series/33407/
State : warning

== Summary ==

Series 33407v2 drm/i915: Include engine state on detecting a missed breadcrumb/seqno
https://patchwork.freedesktop.org/api/1.0/series/33407/revisions/2/mbox/

Test gem_exec_reloc:

        Subgroup basic-gtt-active:
                fail       -> PASS       (fi-gdg-551) fdo#102582 +2
Test kms_frontbuffer_tracking:
        Subgroup basic:
                pass       -> DMESG-WARN (fi-bdw-5557u) fdo#102473
Test drv_module_reload:
        Subgroup basic-reload-inject:
                pass       -> DMESG-WARN (fi-bsw-n3050)

fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102473 https://bugs.freedesktop.org/show_bug.cgi?id=102473

fi-bdw-5557u     total:289  pass:267  dwarn:1   dfail:0   fail:0   skip:21  time:443s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:450s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:380s
fi-bsw-n3050     total:289  pass:242  dwarn:1   dfail:0   fail:0   skip:46  time:537s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:274s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:500s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:499s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:501s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:486s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:427s
fi-gdg-551       total:289  pass:176  dwarn:1   dfail:0   fail:3   skip:109 time:260s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:542s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:428s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:438s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:430s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:458s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:490s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:526s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:472s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:539s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:581s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:549s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:520s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:499s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:455s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:561s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:426s
Blacklisted hosts:
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:547s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:494s

65dc54b704d3ee0486f9f5b11f00c28973f783a2 drm-tip: 2017y-11m-09d-08h-53m-46s UTC integration manifest ed6dee71ffa2 drm/i915: Include engine state on detecting a missed breadcrumb/seqno

== Logs ==

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