Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
@ 2023-06-16 11:05 Bommu Krishnaiah
  2023-06-19  5:52 ` Zbigniew Kempczyński
  2023-06-19 14:13 ` Kamil Konieczny
  0 siblings, 2 replies; 6+ messages in thread
From: Bommu Krishnaiah @ 2023-06-16 11:05 UTC (permalink / raw)
  To: igt-dev; +Cc: Bommu Krishnaiah

Increase fence timeout to 100 seconds for simulation env.
Value is determined based on experiments.

Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
---
 tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tests/xe/xe_exec_compute_mode.c b/tests/xe/xe_exec_compute_mode.c
index 68519399..aba35c19 100644
--- a/tests/xe/xe_exec_compute_mode.c
+++ b/tests/xe/xe_exec_compute_mode.c
@@ -113,6 +113,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	} *data;
 	int i, j, b;
 	int map_fd = -1;
+	int64_t fence_timeout;
 
 	igt_assert(n_engines <= MAX_N_ENGINES);
 
@@ -184,7 +185,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 					 to_user_pointer(data), addr,
 					 bo_size, sync, 1);
 #define ONE_SEC	1000
-	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
+#define HUNDRED_SEC	100000
+
+	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC : ONE_SEC;
+
+	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
+		       fence_timeout);
 	data[0].vm_sync = 0;
 
 	for (i = 0; i < n_execs; i++) {
@@ -210,7 +216,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 
 		if (flags & REBIND && i + 1 != n_execs) {
 			xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
-				       NULL, ONE_SEC);
+				       NULL, fence_timeout);
 			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
 					   addr, bo_size, NULL, 0);
 
@@ -226,7 +232,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 							 addr, bo_size, sync,
 							 1);
 			xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE,
-				       NULL, ONE_SEC);
+				       NULL, fence_timeout);
 			data[0].vm_sync = 0;
 		}
 
@@ -239,7 +245,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 				 * an invalidate.
 				 */
 				xe_wait_ufence(fd, &data[i].exec_sync,
-					       USER_FENCE_VALUE, NULL, ONE_SEC);
+					       USER_FENCE_VALUE, NULL,
+					       fence_timeout);
 				igt_assert_eq(data[i].data, 0xc0ffee);
 			} else if (i * 2 != n_execs) {
 				/*
@@ -269,7 +276,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	j = flags & INVALIDATE ? n_execs - 1 : 0;
 	for (i = j; i < n_execs; i++)
 		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE, NULL,
-			       ONE_SEC);
+			       fence_timeout);
 
 	/* Wait for all execs to complete */
 	if (flags & INVALIDATE)
@@ -278,7 +285,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	sync[0].addr = to_user_pointer(&data[0].vm_sync);
 	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
 			   sync, 1);
-	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
+	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
+		       fence_timeout);
 
 	for (i = j; i < n_execs; i++)
 		igt_assert_eq(data[i].data, 0xc0ffee);
-- 
2.25.1

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

* Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
  2023-06-16 11:05 [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env Bommu Krishnaiah
@ 2023-06-19  5:52 ` Zbigniew Kempczyński
  2023-06-20  9:38   ` Bommu, Krishnaiah
  2023-06-19 14:13 ` Kamil Konieczny
  1 sibling, 1 reply; 6+ messages in thread
From: Zbigniew Kempczyński @ 2023-06-19  5:52 UTC (permalink / raw)
  To: Bommu Krishnaiah; +Cc: igt-dev

On Fri, Jun 16, 2023 at 04:35:19PM +0530, Bommu Krishnaiah wrote:
> Increase fence timeout to 100 seconds for simulation env.
> Value is determined based on experiments.
> 
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> ---
>  tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/xe/xe_exec_compute_mode.c b/tests/xe/xe_exec_compute_mode.c
> index 68519399..aba35c19 100644
> --- a/tests/xe/xe_exec_compute_mode.c
> +++ b/tests/xe/xe_exec_compute_mode.c
> @@ -113,6 +113,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	} *data;
>  	int i, j, b;
>  	int map_fd = -1;
> +	int64_t fence_timeout;
>  
>  	igt_assert(n_engines <= MAX_N_ENGINES);
>  
> @@ -184,7 +185,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  					 to_user_pointer(data), addr,
>  					 bo_size, sync, 1);
>  #define ONE_SEC	1000
> -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
> +#define HUNDRED_SEC	100000

Be aware we're going to switch to nanoseconds as a timeout, more info here:

https://patchwork.freedesktop.org/series/118670/

--
Zbigniew

> +
> +	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC : ONE_SEC;
> +
> +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> +		       fence_timeout);
>  	data[0].vm_sync = 0;
>  
>  	for (i = 0; i < n_execs; i++) {
> @@ -210,7 +216,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  
>  		if (flags & REBIND && i + 1 != n_execs) {
>  			xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
> -				       NULL, ONE_SEC);
> +				       NULL, fence_timeout);
>  			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
>  					   addr, bo_size, NULL, 0);
>  
> @@ -226,7 +232,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  							 addr, bo_size, sync,
>  							 1);
>  			xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE,
> -				       NULL, ONE_SEC);
> +				       NULL, fence_timeout);
>  			data[0].vm_sync = 0;
>  		}
>  
> @@ -239,7 +245,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  				 * an invalidate.
>  				 */
>  				xe_wait_ufence(fd, &data[i].exec_sync,
> -					       USER_FENCE_VALUE, NULL, ONE_SEC);
> +					       USER_FENCE_VALUE, NULL,
> +					       fence_timeout);
>  				igt_assert_eq(data[i].data, 0xc0ffee);
>  			} else if (i * 2 != n_execs) {
>  				/*
> @@ -269,7 +276,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	j = flags & INVALIDATE ? n_execs - 1 : 0;
>  	for (i = j; i < n_execs; i++)
>  		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE, NULL,
> -			       ONE_SEC);
> +			       fence_timeout);
>  
>  	/* Wait for all execs to complete */
>  	if (flags & INVALIDATE)
> @@ -278,7 +285,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	sync[0].addr = to_user_pointer(&data[0].vm_sync);
>  	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
>  			   sync, 1);
> -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
> +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> +		       fence_timeout);
>  
>  	for (i = j; i < n_execs; i++)
>  		igt_assert_eq(data[i].data, 0xc0ffee);
> -- 
> 2.25.1
> 

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

* Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
  2023-06-16 11:05 [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env Bommu Krishnaiah
  2023-06-19  5:52 ` Zbigniew Kempczyński
@ 2023-06-19 14:13 ` Kamil Konieczny
  2023-06-19 16:39   ` Bommu, Krishnaiah
  1 sibling, 1 reply; 6+ messages in thread
From: Kamil Konieczny @ 2023-06-19 14:13 UTC (permalink / raw)
  To: igt-dev; +Cc: Krishnaiah Bommu

Hi Krishnaiah,

small nit: remove space between "tests/" and name of the test:

[PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
------------- ^

should be:
[PATCH] tests/xe_exec_compute_mode: Increase fence timeout for simulation env

Regards,
Kamil

On 2023-06-16 at 16:35:19 +0530, Bommu Krishnaiah wrote:
> Increase fence timeout to 100 seconds for simulation env.
> Value is determined based on experiments.
> 
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> ---
>  tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/xe/xe_exec_compute_mode.c b/tests/xe/xe_exec_compute_mode.c
> index 68519399..aba35c19 100644
> --- a/tests/xe/xe_exec_compute_mode.c
> +++ b/tests/xe/xe_exec_compute_mode.c
> @@ -113,6 +113,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	} *data;
>  	int i, j, b;
>  	int map_fd = -1;
> +	int64_t fence_timeout;
>  
>  	igt_assert(n_engines <= MAX_N_ENGINES);
>  
> @@ -184,7 +185,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  					 to_user_pointer(data), addr,
>  					 bo_size, sync, 1);
>  #define ONE_SEC	1000
> -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
> +#define HUNDRED_SEC	100000
> +
> +	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC : ONE_SEC;
> +
> +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> +		       fence_timeout);
>  	data[0].vm_sync = 0;
>  
>  	for (i = 0; i < n_execs; i++) {
> @@ -210,7 +216,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  
>  		if (flags & REBIND && i + 1 != n_execs) {
>  			xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
> -				       NULL, ONE_SEC);
> +				       NULL, fence_timeout);
>  			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
>  					   addr, bo_size, NULL, 0);
>  
> @@ -226,7 +232,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  							 addr, bo_size, sync,
>  							 1);
>  			xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE,
> -				       NULL, ONE_SEC);
> +				       NULL, fence_timeout);
>  			data[0].vm_sync = 0;
>  		}
>  
> @@ -239,7 +245,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  				 * an invalidate.
>  				 */
>  				xe_wait_ufence(fd, &data[i].exec_sync,
> -					       USER_FENCE_VALUE, NULL, ONE_SEC);
> +					       USER_FENCE_VALUE, NULL,
> +					       fence_timeout);
>  				igt_assert_eq(data[i].data, 0xc0ffee);
>  			} else if (i * 2 != n_execs) {
>  				/*
> @@ -269,7 +276,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	j = flags & INVALIDATE ? n_execs - 1 : 0;
>  	for (i = j; i < n_execs; i++)
>  		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE, NULL,
> -			       ONE_SEC);
> +			       fence_timeout);
>  
>  	/* Wait for all execs to complete */
>  	if (flags & INVALIDATE)
> @@ -278,7 +285,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
>  	sync[0].addr = to_user_pointer(&data[0].vm_sync);
>  	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
>  			   sync, 1);
> -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
> +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> +		       fence_timeout);
>  
>  	for (i = j; i < n_execs; i++)
>  		igt_assert_eq(data[i].data, 0xc0ffee);
> -- 
> 2.25.1
> 

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

* Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
  2023-06-19 14:13 ` Kamil Konieczny
@ 2023-06-19 16:39   ` Bommu, Krishnaiah
  0 siblings, 0 replies; 6+ messages in thread
From: Bommu, Krishnaiah @ 2023-06-19 16:39 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Sent: 19 June 2023 19:43
> To: igt-dev@lists.freedesktop.org
> Cc: Bommu, Krishnaiah <krishnaiah.bommu@intel.com>
> Subject: Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase
> fence timeout for simulation env
> 
> Hi Krishnaiah,
> 
> small nit: remove space between "tests/" and name of the test:
> 
> [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for
> simulation env
> ------------- ^

I will remove space, by mistake I added space
Regards,
Krishna.

> 
> should be:
> [PATCH] tests/xe_exec_compute_mode: Increase fence timeout for
> simulation env
> 
> Regards,
> Kamil
> 
> On 2023-06-16 at 16:35:19 +0530, Bommu Krishnaiah wrote:
> > Increase fence timeout to 100 seconds for simulation env.
> > Value is determined based on experiments.
> >
> > Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> > ---
> >  tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/xe/xe_exec_compute_mode.c
> > b/tests/xe/xe_exec_compute_mode.c index 68519399..aba35c19 100644
> > --- a/tests/xe/xe_exec_compute_mode.c
> > +++ b/tests/xe/xe_exec_compute_mode.c
> > @@ -113,6 +113,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	} *data;
> >  	int i, j, b;
> >  	int map_fd = -1;
> > +	int64_t fence_timeout;
> >
> >  	igt_assert(n_engines <= MAX_N_ENGINES);
> >
> > @@ -184,7 +185,12 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  					 to_user_pointer(data), addr,
> >  					 bo_size, sync, 1);
> >  #define ONE_SEC	1000
> > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +#define HUNDRED_SEC	100000
> > +
> > +	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC :
> ONE_SEC;
> > +
> > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > +		       fence_timeout);
> >  	data[0].vm_sync = 0;
> >
> >  	for (i = 0; i < n_execs; i++) {
> > @@ -210,7 +216,7 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> >
> >  		if (flags & REBIND && i + 1 != n_execs) {
> >  			xe_wait_ufence(fd, &data[i].exec_sync,
> USER_FENCE_VALUE,
> > -				       NULL, ONE_SEC);
> > +				       NULL, fence_timeout);
> >  			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
> >  					   addr, bo_size, NULL, 0);
> >
> > @@ -226,7 +232,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  							 addr, bo_size, sync,
> >  							 1);
> >  			xe_wait_ufence(fd, &data[0].vm_sync,
> USER_FENCE_VALUE,
> > -				       NULL, ONE_SEC);
> > +				       NULL, fence_timeout);
> >  			data[0].vm_sync = 0;
> >  		}
> >
> > @@ -239,7 +245,8 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  				 * an invalidate.
> >  				 */
> >  				xe_wait_ufence(fd, &data[i].exec_sync,
> > -					       USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +					       USER_FENCE_VALUE, NULL,
> > +					       fence_timeout);
> >  				igt_assert_eq(data[i].data, 0xc0ffee);
> >  			} else if (i * 2 != n_execs) {
> >  				/*
> > @@ -269,7 +276,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	j = flags & INVALIDATE ? n_execs - 1 : 0;
> >  	for (i = j; i < n_execs; i++)
> >  		xe_wait_ufence(fd, &data[i].exec_sync,
> USER_FENCE_VALUE, NULL,
> > -			       ONE_SEC);
> > +			       fence_timeout);
> >
> >  	/* Wait for all execs to complete */
> >  	if (flags & INVALIDATE)
> > @@ -278,7 +285,8 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	sync[0].addr = to_user_pointer(&data[0].vm_sync);
> >  	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
> >  			   sync, 1);
> > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > +		       fence_timeout);
> >
> >  	for (i = j; i < n_execs; i++)
> >  		igt_assert_eq(data[i].data, 0xc0ffee);
> > --
> > 2.25.1
> >

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

* Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
  2023-06-19  5:52 ` Zbigniew Kempczyński
@ 2023-06-20  9:38   ` Bommu, Krishnaiah
  2023-06-20 10:56     ` Zbigniew Kempczyński
  0 siblings, 1 reply; 6+ messages in thread
From: Bommu, Krishnaiah @ 2023-06-20  9:38 UTC (permalink / raw)
  To: Kempczynski, Zbigniew; +Cc: igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: Kempczynski, Zbigniew <zbigniew.kempczynski@intel.com>
> Sent: 19 June 2023 11:23
> To: Bommu, Krishnaiah <krishnaiah.bommu@intel.com>
> Cc: igt-dev@lists.freedesktop.org
> Subject: Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase
> fence timeout for simulation env
> 
> On Fri, Jun 16, 2023 at 04:35:19PM +0530, Bommu Krishnaiah wrote:
> > Increase fence timeout to 100 seconds for simulation env.
> > Value is determined based on experiments.
> >
> > Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> > ---
> >  tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/xe/xe_exec_compute_mode.c
> > b/tests/xe/xe_exec_compute_mode.c index 68519399..aba35c19 100644
> > --- a/tests/xe/xe_exec_compute_mode.c
> > +++ b/tests/xe/xe_exec_compute_mode.c
> > @@ -113,6 +113,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	} *data;
> >  	int i, j, b;
> >  	int map_fd = -1;
> > +	int64_t fence_timeout;
> >
> >  	igt_assert(n_engines <= MAX_N_ENGINES);
> >
> > @@ -184,7 +185,12 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  					 to_user_pointer(data), addr,
> >  					 bo_size, sync, 1);
> >  #define ONE_SEC	1000
> > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +#define HUNDRED_SEC	100000
> 
> Be aware we're going to switch to nanoseconds as a timeout, more info here:
> 
> https://patchwork.freedesktop.org/series/118670/
> 
@Kempczynski, Zbigniew should I need to wait until https://patchwork.freedesktop.org/series/118670/ is merged, or should I need to merge with fixme

Regards,
Krishna.

> --
> Zbigniew
> 
> > +
> > +	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC :
> ONE_SEC;
> > +
> > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > +		       fence_timeout);
> >  	data[0].vm_sync = 0;
> >
> >  	for (i = 0; i < n_execs; i++) {
> > @@ -210,7 +216,7 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> >
> >  		if (flags & REBIND && i + 1 != n_execs) {
> >  			xe_wait_ufence(fd, &data[i].exec_sync,
> USER_FENCE_VALUE,
> > -				       NULL, ONE_SEC);
> > +				       NULL, fence_timeout);
> >  			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
> >  					   addr, bo_size, NULL, 0);
> >
> > @@ -226,7 +232,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  							 addr, bo_size, sync,
> >  							 1);
> >  			xe_wait_ufence(fd, &data[0].vm_sync,
> USER_FENCE_VALUE,
> > -				       NULL, ONE_SEC);
> > +				       NULL, fence_timeout);
> >  			data[0].vm_sync = 0;
> >  		}
> >
> > @@ -239,7 +245,8 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  				 * an invalidate.
> >  				 */
> >  				xe_wait_ufence(fd, &data[i].exec_sync,
> > -					       USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +					       USER_FENCE_VALUE, NULL,
> > +					       fence_timeout);
> >  				igt_assert_eq(data[i].data, 0xc0ffee);
> >  			} else if (i * 2 != n_execs) {
> >  				/*
> > @@ -269,7 +276,7 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	j = flags & INVALIDATE ? n_execs - 1 : 0;
> >  	for (i = j; i < n_execs; i++)
> >  		xe_wait_ufence(fd, &data[i].exec_sync,
> USER_FENCE_VALUE, NULL,
> > -			       ONE_SEC);
> > +			       fence_timeout);
> >
> >  	/* Wait for all execs to complete */
> >  	if (flags & INVALIDATE)
> > @@ -278,7 +285,8 @@ test_exec(int fd, struct
> drm_xe_engine_class_instance *eci,
> >  	sync[0].addr = to_user_pointer(&data[0].vm_sync);
> >  	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
> >  			   sync, 1);
> > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> ONE_SEC);
> > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > +		       fence_timeout);
> >
> >  	for (i = j; i < n_execs; i++)
> >  		igt_assert_eq(data[i].data, 0xc0ffee);
> > --
> > 2.25.1
> >

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

* Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
  2023-06-20  9:38   ` Bommu, Krishnaiah
@ 2023-06-20 10:56     ` Zbigniew Kempczyński
  0 siblings, 0 replies; 6+ messages in thread
From: Zbigniew Kempczyński @ 2023-06-20 10:56 UTC (permalink / raw)
  To: Bommu, Krishnaiah; +Cc: igt-dev@lists.freedesktop.org

On Tue, Jun 20, 2023 at 11:38:20AM +0200, Bommu, Krishnaiah wrote:
> 
> 
> > -----Original Message-----
> > From: Kempczynski, Zbigniew <zbigniew.kempczynski@intel.com>
> > Sent: 19 June 2023 11:23
> > To: Bommu, Krishnaiah <krishnaiah.bommu@intel.com>
> > Cc: igt-dev@lists.freedesktop.org
> > Subject: Re: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase
> > fence timeout for simulation env
> > 
> > On Fri, Jun 16, 2023 at 04:35:19PM +0530, Bommu Krishnaiah wrote:
> > > Increase fence timeout to 100 seconds for simulation env.
> > > Value is determined based on experiments.
> > >
> > > Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> > > ---
> > >  tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
> > >  1 file changed, 14 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/tests/xe/xe_exec_compute_mode.c
> > > b/tests/xe/xe_exec_compute_mode.c index 68519399..aba35c19 100644
> > > --- a/tests/xe/xe_exec_compute_mode.c
> > > +++ b/tests/xe/xe_exec_compute_mode.c
> > > @@ -113,6 +113,7 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  	} *data;
> > >  	int i, j, b;
> > >  	int map_fd = -1;
> > > +	int64_t fence_timeout;
> > >
> > >  	igt_assert(n_engines <= MAX_N_ENGINES);
> > >
> > > @@ -184,7 +185,12 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  					 to_user_pointer(data), addr,
> > >  					 bo_size, sync, 1);
> > >  #define ONE_SEC	1000
> > > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > ONE_SEC);
> > > +#define HUNDRED_SEC	100000
> > 
> > Be aware we're going to switch to nanoseconds as a timeout, more info here:
> > 
> > https://patchwork.freedesktop.org/series/118670/
> > 
> @Kempczynski, Zbigniew should I need to wait until https://patchwork.freedesktop.org/series/118670/ is merged, or should I need to merge with fixme

Don't use fixme tag. At the moment you can merge your change, but we will
need fix all user fence wait usages in all igts when this uapi change will
land.

--
Zbigniew

--
> 
> Regards,
> Krishna.
> 
> > --
> > Zbigniew
> > 
> > > +
> > > +	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC :
> > ONE_SEC;
> > > +
> > > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > > +		       fence_timeout);
> > >  	data[0].vm_sync = 0;
> > >
> > >  	for (i = 0; i < n_execs; i++) {
> > > @@ -210,7 +216,7 @@ test_exec(int fd, struct
> > > drm_xe_engine_class_instance *eci,
> > >
> > >  		if (flags & REBIND && i + 1 != n_execs) {
> > >  			xe_wait_ufence(fd, &data[i].exec_sync,
> > USER_FENCE_VALUE,
> > > -				       NULL, ONE_SEC);
> > > +				       NULL, fence_timeout);
> > >  			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
> > >  					   addr, bo_size, NULL, 0);
> > >
> > > @@ -226,7 +232,7 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  							 addr, bo_size, sync,
> > >  							 1);
> > >  			xe_wait_ufence(fd, &data[0].vm_sync,
> > USER_FENCE_VALUE,
> > > -				       NULL, ONE_SEC);
> > > +				       NULL, fence_timeout);
> > >  			data[0].vm_sync = 0;
> > >  		}
> > >
> > > @@ -239,7 +245,8 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  				 * an invalidate.
> > >  				 */
> > >  				xe_wait_ufence(fd, &data[i].exec_sync,
> > > -					       USER_FENCE_VALUE, NULL,
> > ONE_SEC);
> > > +					       USER_FENCE_VALUE, NULL,
> > > +					       fence_timeout);
> > >  				igt_assert_eq(data[i].data, 0xc0ffee);
> > >  			} else if (i * 2 != n_execs) {
> > >  				/*
> > > @@ -269,7 +276,7 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  	j = flags & INVALIDATE ? n_execs - 1 : 0;
> > >  	for (i = j; i < n_execs; i++)
> > >  		xe_wait_ufence(fd, &data[i].exec_sync,
> > USER_FENCE_VALUE, NULL,
> > > -			       ONE_SEC);
> > > +			       fence_timeout);
> > >
> > >  	/* Wait for all execs to complete */
> > >  	if (flags & INVALIDATE)
> > > @@ -278,7 +285,8 @@ test_exec(int fd, struct
> > drm_xe_engine_class_instance *eci,
> > >  	sync[0].addr = to_user_pointer(&data[0].vm_sync);
> > >  	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
> > >  			   sync, 1);
> > > -	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > ONE_SEC);
> > > +	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
> > > +		       fence_timeout);
> > >
> > >  	for (i = j; i < n_execs; i++)
> > >  		igt_assert_eq(data[i].data, 0xc0ffee);
> > > --
> > > 2.25.1
> > >

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

end of thread, other threads:[~2023-06-20 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 11:05 [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env Bommu Krishnaiah
2023-06-19  5:52 ` Zbigniew Kempczyński
2023-06-20  9:38   ` Bommu, Krishnaiah
2023-06-20 10:56     ` Zbigniew Kempczyński
2023-06-19 14:13 ` Kamil Konieczny
2023-06-19 16:39   ` Bommu, Krishnaiah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox