diff mbox series

[i-g-t] tests/i915/gem_ctx_persistence: adjust timeout according to engines

Message ID 20221207114730.77304-1-andrzej.hajda@intel.com (mailing list archive)
State New, archived
Headers show
Series [i-g-t] tests/i915/gem_ctx_persistence: adjust timeout according to engines | expand

Commit Message

Andrzej Hajda Dec. 7, 2022, 11:47 a.m. UTC
With introduction of long running compute context preemption timeouts
in some engines (rcs and ccs) can be quite big (by default 7.5s).
Keeping spinner timeout to at least twice bigger than engines preemption
timeout should allow to finish the test without -ETIME error.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2410
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 tests/i915/gem_ctx_persistence.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Tvrtko Ursulin Dec. 7, 2022, 12:08 p.m. UTC | #1
On 07/12/2022 11:47, Andrzej Hajda wrote:
> With introduction of long running compute context preemption timeouts
> in some engines (rcs and ccs) can be quite big (by default 7.5s).
> Keeping spinner timeout to at least twice bigger than engines preemption
> timeout should allow to finish the test without -ETIME error.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2410
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> ---
>   tests/i915/gem_ctx_persistence.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c
> index a844439de19..9fb52818616 100644
> --- a/tests/i915/gem_ctx_persistence.c
> +++ b/tests/i915/gem_ctx_persistence.c
> @@ -1173,6 +1173,14 @@ static void many_contexts(int i915, const intel_ctx_cfg_t *cfg)
>   	gem_sync(i915, spin->handle);
>   	igt_spin_reset(spin);
>   
> +	for_each_ctx_cfg_engine(i915, cfg, e) {
> +		int t = 0;
> +
> +		gem_engine_property_scanf(i915, e->name,
> +					  "preempt_timeout_ms", "%d", &t);
> +		timeout = max_t(int64_t, timeout, 2000000ll * t);
> +	}
> +
>   	igt_until_timeout(30) {
>   		for_each_ctx_cfg_engine(i915, cfg, e) {
>   			const intel_ctx_t *ctx;

LGTM. And over time we will see if there will be remaining unexplained 
failures.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c
index a844439de19..9fb52818616 100644
--- a/tests/i915/gem_ctx_persistence.c
+++ b/tests/i915/gem_ctx_persistence.c
@@ -1173,6 +1173,14 @@  static void many_contexts(int i915, const intel_ctx_cfg_t *cfg)
 	gem_sync(i915, spin->handle);
 	igt_spin_reset(spin);
 
+	for_each_ctx_cfg_engine(i915, cfg, e) {
+		int t = 0;
+
+		gem_engine_property_scanf(i915, e->name,
+					  "preempt_timeout_ms", "%d", &t);
+		timeout = max_t(int64_t, timeout, 2000000ll * t);
+	}
+
 	igt_until_timeout(30) {
 		for_each_ctx_cfg_engine(i915, cfg, e) {
 			const intel_ctx_t *ctx;