[igt-dev] [PATCH i-g-t v2 9/9] tests/perf_pmu: Use short batches from hotplug test

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 5 14:37:45 UTC 2018


Quoting Tvrtko Ursulin (2018-02-05 11:38:10)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> This test emits a spin batch which runs roughly for N CPU cores seconds
> As such these can be declared as GPU hangs, so work around that by looping
> with shorter batches.
> 
> v2:
>  * Use overlapping spinners. (Chris Wilson)
>  * Go back to igt_fork. (Chris Wilson)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
> +       /*
> +        * Very long batches can be declared as GPU hangs so emit shorter ones
> +        * until the CPU core shuffler finishes one loop.
> +        */
> +       for (;;) {
> +               char buf;
> +               int ret2;

I didn't mean a new "int ret;" here, just reuse the outer ret :)

>  
> -       igt_spin_batch_end(spin);
> -       gem_sync(gem_fd, spin->handle);
> -       igt_spin_batch_free(gem_fd, spin);
> +               usleep(500e3);
> +               end_spin(gem_fd, spin[cur], 0);
> +
> +               /* Check if the child is signaling completion. */
> +               ret2 = read(link[0], &buf, 1);
> +               if ( ret2 == 1 || (ret2 < 0 && errno != EAGAIN))
                      ^ spare space.

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


More information about the igt-dev mailing list