[igt-dev] [Intel-gfx] [PATCH i-g-t] i915/gem_exec_create: Trim loop counters

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Mar 3 14:34:09 UTC 2020


Chris Wilson <chris at chris-wilson.co.uk> writes:

> gem_create + gem_execbuf should be long enough that the accuracy of
> gettime is insignificant; and this is a test not a benchmark! Remove the
> 1024 loop so that we check for timeout more frequently.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>

> ---
>  tests/i915/gem_exec_create.c | 26 ++++++++++++--------------
>  1 file changed, 12 insertions(+), 14 deletions(-)
>
> diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
> index 102a161d5..e3ceb3f5c 100644
> --- a/tests/i915/gem_exec_create.c
> +++ b/tests/i915/gem_exec_create.c
> @@ -93,23 +93,21 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
>  		count = 0;
>  		clock_gettime(CLOCK_MONOTONIC, &start);
>  		do {
> -			for (int loop = 0; loop < 1024; loop++) {
> -				for (int n = 0; n < nengine; n++) {
> -					obj.handle =  gem_create(fd, 4096);
> -					gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
> -					execbuf.flags &= ~ENGINE_FLAGS;
> -					execbuf.flags |= engines[n];
> -					gem_execbuf(fd, &execbuf);
> -					if (flags & LEAK)
> -						gem_madvise(fd, obj.handle, I915_MADV_DONTNEED);
> -					else
> -						gem_close(fd, obj.handle);
> -				}
> +			for (int n = 0; n < nengine; n++) {
> +				obj.handle = gem_create(fd, 4096);
> +				gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
> +				execbuf.flags &= ~ENGINE_FLAGS;
> +				execbuf.flags |= engines[n];
> +				gem_execbuf(fd, &execbuf);
> +				if (flags & LEAK)
> +					gem_madvise(fd, obj.handle, I915_MADV_DONTNEED);
> +				else
> +					gem_close(fd, obj.handle);
>  			}
> -			count += nengine * 1024;
> +			count += nengine;
>  			clock_gettime(CLOCK_MONOTONIC, &now);
>  		} while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */
> -		obj.handle =  gem_create(fd, 4096);
> +		obj.handle = gem_create(fd, 4096);
>  		gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
>  		for (int n = 0; n < nengine; n++) {
>  			execbuf.flags &= ~ENGINE_FLAGS;
> -- 
> 2.25.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the igt-dev mailing list