[igt-dev] [igt PATCH v1 1/1] i915/gem_ctx_switch: evenly run 4 child processes

Antonio Argenziano antonio.argenziano at intel.com
Sat Feb 23 01:09:32 UTC 2019



On 22/02/19 22:54, Caz Yokoyama wrote:
> gem_ctx_switch at basic-all-light test creates 4 child processes for each
> engine and wait. render engine runs slower than others. By this patch,
> 4 child processes run fairly evenly. As a result, parent process runs
> faster. On my NUC, its execution time becomes about half.
> 
> Signed-off-by: Caz Yokoyama <caz.yokoyama at intel.com>
> ---
>   tests/i915/gem_ctx_switch.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/i915/gem_ctx_switch.c b/tests/i915/gem_ctx_switch.c
> index 1208cb8d..9ed22f35 100644
> --- a/tests/i915/gem_ctx_switch.c
> +++ b/tests/i915/gem_ctx_switch.c
> @@ -247,7 +247,9 @@ static void all(int fd, uint32_t handle, unsigned flags, int timeout)
>   
>   				clock_gettime(CLOCK_MONOTONIC, &start);
>   				do {
> -					for (int loop = 0; loop < qlen; loop++) {
> +					int x = strcmp(name[child], "render") == 0 ? qlen/2 : qlen;
> +
> +					for (int loop = 0; loop < x; loop++) {

Beware that count becomes incorrect. It should be:
count += x;

Antonio

>   						execbuf.rsvd1 = contexts[loop % nctx];
>   						gem_execbuf(fd, &execbuf);
>   					}
> 


More information about the igt-dev mailing list