[Intel-gfx] [PATCH] drm/i915: fix exiting context timeout calculation

Andrzej Hajda andrzej.hajda at intel.com
Mon Nov 28 16:52:09 UTC 2022


In case context is exiting preempt_timeout_ms is used for timeout,
but since introduction of DRM_I915_PREEMPT_TIMEOUT_COMPUTE it increases
to 7.5 seconds. Heartbeat occurs earlier but it is still 2.5s.

Fixes: d7a8680ec9fb21 ("drm/i915: Improve long running compute w/a for GuC submission")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2410
Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
---
Hi all,

I am not sure what is expected solution here, and if my patch does not
actually reverts intentions of patch d7a8680ec9fb21. Feel free to propose
something better.
Other alternative would be to increase t/o in IGT tests, but I am not sure
if this is good direction.

Regards
Andrzej
---
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index 49a8f10d76c77b..bbbbcd9e00f947 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -1248,6 +1248,10 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine,
 	/* Force a fast reset for terminated contexts (ignoring sysfs!) */
 	if (unlikely(intel_context_is_banned(rq->context) || bad_request(rq)))
 		return INTEL_CONTEXT_BANNED_PREEMPT_TIMEOUT_MS;
+	else if (unlikely(intel_context_is_exiting(rq->context)))
+		return min_t(typeof(unsigned long),
+			     READ_ONCE(engine->props.preempt_timeout_ms),
+			     CONFIG_DRM_I915_PREEMPT_TIMEOUT);
 
 	return READ_ONCE(engine->props.preempt_timeout_ms);
 }
-- 
2.34.1



More information about the Intel-gfx mailing list