From: Chris Wilson <chris@chris-wilson.co.uk> To: igt-dev@lists.freedesktop.org, joonas.lahtinen@linux.intel.com Cc: intel-gfx@lists.freedesktop.org Subject: [PATCH igt 14/16] igt/gem_ctx_switch: Exercise all engines at once Date: Tue, 20 Feb 2018 08:45:18 +0000 [thread overview] Message-ID: <20180220084520.27965-14-chris@chris-wilson.co.uk> (raw) In-Reply-To: <20180220084520.27965-1-chris@chris-wilson.co.uk> Just a small variant to apply a continuous context-switch load to all engines. --- tests/gem_ctx_switch.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c index e0ab3d18..9b5560c0 100644 --- a/tests/gem_ctx_switch.c +++ b/tests/gem_ctx_switch.c @@ -133,6 +133,77 @@ static void single(int fd, uint32_t handle, gem_context_destroy(fd, contexts[n]); } +static void all(int fd, uint32_t handle, unsigned flags, int timeout) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + unsigned int engine[16], e; + const char *name[16]; + uint32_t contexts[64]; + unsigned int nengine; + int n; + + nengine = 0; + for_each_engine(fd, e) { + if (e == 0 || e == I915_EXEC_BSD) + continue; + + engine[nengine] = e; + name[nengine] = e__->name; + nengine++; + } + igt_require(nengine); + + igt_require(__gem_context_create(fd, &contexts[0]) == 0); + for (n = 1; n < 64; n++) + contexts[n] = gem_context_create(fd); + + memset(obj, 0, sizeof(obj)); + obj[1].handle = handle; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = to_user_pointer(obj + 1); + execbuf.buffer_count = 1; + execbuf.rsvd1 = contexts[0]; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + gem_sync(fd, handle); + execbuf.buffers_ptr = to_user_pointer(obj); + execbuf.buffer_count = 2; + + igt_fork(child, nengine) { + struct timespec start, now; + unsigned int count = 0; + + obj[0].handle = gem_create(fd, 4096); + execbuf.flags |= engine[child]; + gem_execbuf(fd, &execbuf); + gem_sync(fd, obj[0].handle); + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int loop = 0; loop < 64; loop++) { + execbuf.rsvd1 = contexts[loop % 64]; + gem_execbuf(fd, &execbuf); + } + count += 64; + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < timeout); + gem_sync(fd, obj[0].handle); + clock_gettime(CLOCK_MONOTONIC, &now); + gem_close(fd, obj[0].handle); + + igt_info("[%d] %s: %'u cycles: %.3fus%s\n", + child, name[child], count, elapsed(&start, &now)*1e6 / count, + flags & INTERRUPTIBLE ? " (interruptible)" : ""); + } + igt_waitchildren(); + + for (n = 0; n < 64; n++) + gem_context_destroy(fd, contexts[n]); +} + igt_main { const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -175,6 +246,11 @@ igt_main single(fd, light, e, INTERRUPTIBLE, ncpus, 150); } + igt_subtest("basic-all") + all(fd, light, 0, 20); + igt_subtest("basic-all-heavy") + all(fd, heavy, 0, 20); + igt_fixture { igt_stop_hang_detector(); gem_close(fd, heavy); -- 2.16.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk> To: igt-dev@lists.freedesktop.org, joonas.lahtinen@linux.intel.com Cc: intel-gfx@lists.freedesktop.org Subject: [igt-dev] [PATCH igt 14/16] igt/gem_ctx_switch: Exercise all engines at once Date: Tue, 20 Feb 2018 08:45:18 +0000 [thread overview] Message-ID: <20180220084520.27965-14-chris@chris-wilson.co.uk> (raw) In-Reply-To: <20180220084520.27965-1-chris@chris-wilson.co.uk> Just a small variant to apply a continuous context-switch load to all engines. --- tests/gem_ctx_switch.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c index e0ab3d18..9b5560c0 100644 --- a/tests/gem_ctx_switch.c +++ b/tests/gem_ctx_switch.c @@ -133,6 +133,77 @@ static void single(int fd, uint32_t handle, gem_context_destroy(fd, contexts[n]); } +static void all(int fd, uint32_t handle, unsigned flags, int timeout) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_exec_object2 obj[2]; + unsigned int engine[16], e; + const char *name[16]; + uint32_t contexts[64]; + unsigned int nengine; + int n; + + nengine = 0; + for_each_engine(fd, e) { + if (e == 0 || e == I915_EXEC_BSD) + continue; + + engine[nengine] = e; + name[nengine] = e__->name; + nengine++; + } + igt_require(nengine); + + igt_require(__gem_context_create(fd, &contexts[0]) == 0); + for (n = 1; n < 64; n++) + contexts[n] = gem_context_create(fd); + + memset(obj, 0, sizeof(obj)); + obj[1].handle = handle; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = to_user_pointer(obj + 1); + execbuf.buffer_count = 1; + execbuf.rsvd1 = contexts[0]; + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + igt_require(__gem_execbuf(fd, &execbuf) == 0); + gem_sync(fd, handle); + execbuf.buffers_ptr = to_user_pointer(obj); + execbuf.buffer_count = 2; + + igt_fork(child, nengine) { + struct timespec start, now; + unsigned int count = 0; + + obj[0].handle = gem_create(fd, 4096); + execbuf.flags |= engine[child]; + gem_execbuf(fd, &execbuf); + gem_sync(fd, obj[0].handle); + + clock_gettime(CLOCK_MONOTONIC, &start); + do { + for (int loop = 0; loop < 64; loop++) { + execbuf.rsvd1 = contexts[loop % 64]; + gem_execbuf(fd, &execbuf); + } + count += 64; + clock_gettime(CLOCK_MONOTONIC, &now); + } while (elapsed(&start, &now) < timeout); + gem_sync(fd, obj[0].handle); + clock_gettime(CLOCK_MONOTONIC, &now); + gem_close(fd, obj[0].handle); + + igt_info("[%d] %s: %'u cycles: %.3fus%s\n", + child, name[child], count, elapsed(&start, &now)*1e6 / count, + flags & INTERRUPTIBLE ? " (interruptible)" : ""); + } + igt_waitchildren(); + + for (n = 0; n < 64; n++) + gem_context_destroy(fd, contexts[n]); +} + igt_main { const int ncpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -175,6 +246,11 @@ igt_main single(fd, light, e, INTERRUPTIBLE, ncpus, 150); } + igt_subtest("basic-all") + all(fd, light, 0, 20); + igt_subtest("basic-all-heavy") + all(fd, heavy, 0, 20); + igt_fixture { igt_stop_hang_detector(); gem_close(fd, heavy); -- 2.16.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-02-20 8:45 UTC|newest] Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-02-20 8:45 [PATCH igt 01/16] igt/gem_sync: Exercise and measure idle requests Chris Wilson 2018-02-20 8:45 ` [Intel-gfx] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 02/16] lib: Cache the debugfs mountpoint Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 03/16] lib: Always set mismatching index for igt_find_crc_mismatch Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 04/16] igt/gem_exec_flush: Silence old compiler warning Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 05/16] igt/syncobj: Tidy ye olde compiler warnings Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 06/16] lib: Remove overzealous assertion on gem_set_caching() Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 07/16] igt/gem_exec_schedule: Trim max number of contexts used Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 10:52 ` Joonas Lahtinen 2018-02-20 10:52 ` [Intel-gfx] " Joonas Lahtinen 2018-02-20 8:45 ` [PATCH igt 08/16] igt/gem_exec_schedule: Replace constant 16 with its magic macro Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 10:57 ` Joonas Lahtinen 2018-02-20 10:57 ` [igt-dev] " Joonas Lahtinen 2018-02-20 11:01 ` Chris Wilson 2018-02-20 11:01 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 09/16] igt/gem_fenced_exec_thrash: Use fixed durations Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 10/16] igt/gem_eio: Use slow spinners to inject hangs Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 11:14 ` Joonas Lahtinen 2018-02-20 11:14 ` [Intel-gfx] " Joonas Lahtinen 2018-02-20 8:45 ` [PATCH igt 11/16] igt/gem_eio: Exercise set-wedging against request submission Chris Wilson 2018-02-20 8:45 ` [Intel-gfx] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 12/16] igt/gem_ctx_isolation: Check isolation of registers between contexts Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 14:56 ` Joonas Lahtinen 2018-02-20 14:56 ` [igt-dev] " Joonas Lahtinen 2018-02-20 8:45 ` [PATCH igt 13/16] igt/gem_ctx_switch: Do a warmup pass over all contexts Chris Wilson 2018-02-20 8:45 ` [Intel-gfx] " Chris Wilson 2018-02-20 14:57 ` Joonas Lahtinen 2018-02-20 14:57 ` [igt-dev] " Joonas Lahtinen 2018-02-20 8:45 ` Chris Wilson [this message] 2018-02-20 8:45 ` [igt-dev] [PATCH igt 14/16] igt/gem_ctx_switch: Exercise all engines at once Chris Wilson 2018-02-20 8:45 ` [PATCH igt 15/16] igt/gem_exec_capture: Exercise readback of userptr Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 8:45 ` [PATCH igt 16/16] igt/gem_exec_fence: Exercise merging fences Chris Wilson 2018-02-20 8:45 ` [igt-dev] " Chris Wilson 2018-02-20 9:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [01/16] igt/gem_sync: Exercise and measure idle requests Patchwork 2018-02-20 10:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2018-03-05 13:43 ` [PATCH igt 01/16] " Joonas Lahtinen 2018-03-05 13:43 ` [igt-dev] " Joonas Lahtinen 2018-03-05 14:39 ` Chris Wilson 2018-03-05 14:39 ` [igt-dev] " Chris Wilson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20180220084520.27965-14-chris@chris-wilson.co.uk \ --to=chris@chris-wilson.co.uk \ --cc=igt-dev@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=joonas.lahtinen@linux.intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.