[Intel-gfx] [PATCH i-g-t v2 2/2] tests/gem_exec_schedule: Add test for resetting preemptive batch

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 8 22:06:16 UTC 2017


Quoting Antonio Argenziano (2017-12-04 23:45:41)
> This patch adds a test that will trigger a preemption of a low priority
> batch by a 'bad' batch buffer which will hang. The test aims at making
> sure that a hanging high priority batch will not disrupt the submission
> flow of low priority contexts.
> 
> -v2:
>         - Rename subtest (Chris)
>         - Use igt_hang_ctx to hang ring (Chris)
>         - Add comment on execution order checks (Chris)
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Michal Winiarski <michal.winiarski at intel.com>
> Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> ---
> +static void preemptive_hang(int fd, unsigned ring)
> +{
> +       igt_spin_t *spin[16];

Someone is going to shout one day, what is it with the magic number 16?

#define MAX_ELSP_QLEN 16 ? And should be set to some safe number times
the forseeable future.

> +       igt_hang_t hang;
> +       uint32_t ctx[2];
> +
> +       ctx[HI] = gem_context_create(fd);
> +       gem_context_set_priority(fd, ctx[HI], MAX_PRIO);
> +
> +       for (int n = 0; n < 16; n++) {
> +               ctx[LO] = gem_context_create(fd);
> +               gem_context_set_priority(fd, ctx[LO], MIN_PRIO);
> +
> +               spin[n] = __igt_spin_batch_new(fd, ctx[LO], ring, 0);
> +               igt_debug("spin[%d].handle=%d\n", n, spin[n]->handle);
> +
> +               gem_context_destroy(fd, ctx[LO]);
> +       }
> +
> +       hang = igt_hang_ctx(fd, ctx[HI], ring, 0, NULL);
> +       gem_wait(fd, hang.handle, NULL);

That should be igt_post_hang_ring(fd, hang);
-Chris


More information about the Intel-gfx mailing list