All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Speed up idle detection by kicking the tasklets
@ 2018-05-06 15:15 Chris Wilson
  2018-05-06 15:55 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Chris Wilson @ 2018-05-06 15:15 UTC (permalink / raw)
  To: intel-gfx

We rely on ksoftirqd to run in a timely fashion in order to drain the
execlists queue. Quite frequently, it does not. In some cases we may see
latencies of over 200ms triggering our idle timeouts and forcing us to
declare the driver wedged!

Thus we can speed up idle detection by bypassing ksoftirqd in these
cases and flush our tasklet to confirm if we are indeed still waiting
for the ELSP to drain.

References: https://bugs.freedesktop.org/show_bug.cgi?id=106373
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 70325e0824e3..acf87dc73bf4 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -945,12 +945,17 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine)
 		return true;
 
 	/* Waiting to drain ELSP? */
-	if (READ_ONCE(engine->execlists.active))
-		return false;
+	if (READ_ONCE(engine->execlists.active)) {
+		struct intel_engine_execlists *execlists = &engine->execlists;
 
-	/* ELSP is empty, but there are ready requests? */
-	if (READ_ONCE(engine->execlists.first))
-		return false;
+		if (tasklet_trylock(&execlists->tasklet)) {
+			execlists->tasklet.func(execlists->tasklet.data);
+			tasklet_unlock(&execlists->tasklet);
+		}
+
+		if (READ_ONCE(execlists->active))
+			return false;
+	}
 
 	/* Ring stopped? */
 	if (!ring_is_idle(engine))
-- 
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] 10+ messages in thread

end of thread, other threads:[~2018-05-07  9:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 15:15 [PATCH] drm/i915: Speed up idle detection by kicking the tasklets Chris Wilson
2018-05-06 15:55 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-05-06 16:41 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-05-06 17:13 ` [PATCH v2] " Chris Wilson
2018-05-07  8:34   ` Mika Kuoppala
2018-05-07  8:38     ` Chris Wilson
2018-05-07  8:54       ` Mika Kuoppala
2018-05-07  9:03         ` Chris Wilson
2018-05-06 17:33 ` ✓ Fi.CI.BAT: success for drm/i915: Speed up idle detection by kicking the tasklets (rev2) Patchwork
2018-05-06 18:17 ` ✓ Fi.CI.IGT: " 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.