intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gt: Immediately check for ACK after submission
@ 2020-05-21 12:28 Chris Wilson
  2020-05-21 13:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
  2020-05-22  6:21 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-05-21 12:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

In an extreme case this may reduce the ACK latency by handling the
immediate HW response from a ready engine. That reduction in latency
should not actually impact any submission latency since on the direct
submit path we try and clear any pending interrupts first. On the
indirect reprioritisation or timeslicing paths, latency is not the
primary concern as the HW is still executing and will remain so until we
are able to preempt it (i.e. no reduction in effective pipeline stalls).

Still this may help mitigate the loss of softirq, which is a huge
concern.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/1874
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index de5be57ed6d2..df77ed2a0a53 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -2528,7 +2528,7 @@ gen8_csb_parse(const struct intel_engine_execlists *execlists, const u32 *csb)
 	return *csb & (GEN8_CTX_STATUS_IDLE_ACTIVE | GEN8_CTX_STATUS_PREEMPTED);
 }
 
-static void process_csb(struct intel_engine_cs *engine)
+static bool process_csb(struct intel_engine_cs *engine)
 {
 	struct intel_engine_execlists * const execlists = &engine->execlists;
 	const u32 * const buf = execlists->csb_status;
@@ -2557,7 +2557,7 @@ static void process_csb(struct intel_engine_cs *engine)
 	head = execlists->csb_head;
 	tail = READ_ONCE(*execlists->csb_write);
 	if (unlikely(head == tail))
-		return;
+		return false;
 
 	/*
 	 * Hopefully paired with a wmb() in HW!
@@ -2692,6 +2692,7 @@ static void process_csb(struct intel_engine_cs *engine)
 	 * invalidation before.
 	 */
 	invalidate_csb_entries(&buf[0], &buf[num_entries - 1]);
+	return true;
 }
 
 static void __execlists_submission_tasklet(struct intel_engine_cs *const engine)
@@ -3116,9 +3117,11 @@ static void execlists_submission_tasklet(unsigned long data)
 	if (!READ_ONCE(engine->execlists.pending[0]) || timeout) {
 		unsigned long flags;
 
-		spin_lock_irqsave(&engine->active.lock, flags);
-		__execlists_submission_tasklet(engine);
-		spin_unlock_irqrestore(&engine->active.lock, flags);
+		do {
+			spin_lock_irqsave(&engine->active.lock, flags);
+			__execlists_submission_tasklet(engine);
+			spin_unlock_irqrestore(&engine->active.lock, flags);
+		} while (process_csb(engine));
 
 		/* Recheck after serialising with direct-submission */
 		if (unlikely(timeout && preempt_timeout(engine)))
-- 
2.20.1

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

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

end of thread, other threads:[~2020-05-22  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 12:28 [Intel-gfx] [PATCH] drm/i915/gt: Immediately check for ACK after submission Chris Wilson
2020-05-21 13:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-05-22  6:21 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).