* [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
@ 2022-04-27 6:10 Zbigniew Kempczyński
2022-04-27 6:52 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_softpin: Exercise single offset eviction on all engines (rev2) Patchwork
0 siblings, 1 reply; 8+ messages in thread
From: Zbigniew Kempczyński @ 2022-04-27 6:10 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Hellström
Verify that eviction works when all engines try to use same offset for
different handles. It replaces allocator-evict-all-engines test because
it is simpler.
v2: addressing review comments (Kamil)
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
tests/i915/gem_softpin.c | 88 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 86 insertions(+), 2 deletions(-)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 448b4c4b9e..84fed0720c 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -1073,6 +1073,89 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+#define MINIMAL_OFFSET 0x200000
+static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
+ struct batch *batches, unsigned int count)
+{
+ struct drm_i915_gem_exec_object2 obj;
+ uint64_t address = max_t(uint64_t, gem_detect_safe_start_offset(fd),
+ MINIMAL_OFFSET);
+
+ memset(&obj, 0, sizeof(obj));
+ obj.flags = EXEC_OBJECT_PINNED;
+
+ for (unsigned int i = 0; i < count; i++) {
+ obj.handle = batches[i].handle;
+ obj.offset = address;
+ eb->buffers_ptr = to_user_pointer(&obj);
+ gem_execbuf(fd, eb);
+ }
+}
+
+static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
+{
+ struct drm_i915_gem_execbuffer2 execbuf;
+ struct intel_execution_engine2 *e;
+ unsigned int engines[I915_EXEC_RING_MASK + 1];
+ struct batch *batches;
+ unsigned int nengine;
+ unsigned int count;
+ uint64_t size;
+
+ nengine = 0;
+ for_each_ctx_engine(fd, ctx, e) {
+ engines[nengine++] = e->flags;
+ }
+ igt_require(nengine);
+
+ size = gem_aperture_size(fd);
+ if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
+ size = 1ull << 32;
+ igt_require(size < (1ull<<32) * BATCH_SIZE);
+
+ count = size / BATCH_SIZE + 1;
+ igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
+ count, (long long)size, nengine);
+
+ intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ intel_detect_and_clear_missed_interrupts(fd);
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffer_count = 1;
+ execbuf.rsvd1 = ctx->id;
+
+ batches = calloc(count, sizeof(*batches));
+ igt_assert(batches);
+ for (unsigned int i = 0; i < count; i++) {
+ uint32_t *p;
+
+ batches[i].handle = gem_create(fd, BATCH_SIZE);
+ batches[i].ptr =
+ gem_mmap__device_coherent(fd, batches[i].handle,
+ 0, BATCH_SIZE, PROT_WRITE);
+ p = batches[i].ptr + BATCH_SIZE - 8;
+ *p = MI_BATCH_BUFFER_END;
+ }
+
+ /* Flush all memory before we start the timer */
+ single_offset_submit(fd, &execbuf, batches, count);
+
+ igt_fork(child, nengine) {
+ execbuf.flags |= engines[child];
+ igt_until_timeout(timeout)
+ single_offset_submit(fd, &execbuf, batches, count);
+ }
+ igt_waitchildren();
+
+ for (unsigned int i = 0; i < count; i++) {
+ munmap(batches[i].ptr, BATCH_SIZE);
+ gem_close(fd, batches[i].handle);
+ }
+ free(batches);
+
+ igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+}
+
static void make_batch(int i915, uint32_t handle, uint64_t size)
{
uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
@@ -1213,8 +1296,9 @@ igt_main
test_each_engine("allocator-evict", fd, ctx, e)
test_allocator_evict(fd, ctx, e->flags, 20);
- igt_subtest("allocator-evict-all-engines")
- test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
+ igt_describe("Use same offset for all engines and for different handles");
+ igt_subtest("evict-single-offset")
+ evict_single_offset(fd, ctx, 20);
}
igt_describe("Check start offset and alignment detection");
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_softpin: Exercise single offset eviction on all engines (rev2)
2022-04-27 6:10 [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines Zbigniew Kempczyński
@ 2022-04-27 6:52 ` Patchwork
0 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2022-04-27 6:52 UTC (permalink / raw)
To: Zbigniew Kempczyński; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 8363 bytes --]
== Series Details ==
Series: tests/i915/gem_softpin: Exercise single offset eviction on all engines (rev2)
URL : https://patchwork.freedesktop.org/series/102154/
State : failure
== Summary ==
CI Bug Log - changes from IGT_6456 -> IGTPW_7010
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_7010 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_7010, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/index.html
Participating hosts (46 -> 43)
------------------------------
Additional (2): bat-rpls-1 fi-rkl-11600
Missing (5): fi-hsw-4200u bat-adlm-1 fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_7010:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@evict:
- fi-bdw-5557u: [PASS][1] -> [INCOMPLETE][2] +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6456/fi-bdw-5557u/igt@i915_selftest@live@evict.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-bdw-5557u/igt@i915_selftest@live@evict.html
Known issues
------------
Here are the changes found in IGTPW_7010 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-rkl-11600: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-rkl-11600: NOTRUN -> [SKIP][4] ([i915#4613]) +3 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@gem_lmem_swapping@basic.html
* igt@gem_tiled_pread_basic:
- fi-rkl-11600: NOTRUN -> [SKIP][5] ([i915#3282])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@gem_tiled_pread_basic.html
* igt@i915_pm_backlight@basic-brightness:
- fi-rkl-11600: NOTRUN -> [SKIP][6] ([i915#3012])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
* igt@i915_pm_rpm@module-reload:
- fi-cfl-8109u: [PASS][7] -> [DMESG-WARN][8] ([i915#62]) +16 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6456/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-g3258: NOTRUN -> [SKIP][9] ([fdo#109271] / [fdo#111827])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-hsw-g3258/igt@kms_chamelium@common-hpd-after-suspend.html
- fi-snb-2600: NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-snb-2600/igt@kms_chamelium@common-hpd-after-suspend.html
* igt@kms_chamelium@dp-crc-fast:
- fi-rkl-11600: NOTRUN -> [SKIP][11] ([fdo#111827]) +8 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_chamelium@dp-crc-fast.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-rkl-11600: NOTRUN -> [SKIP][12] ([i915#4070] / [i915#4103]) +1 similar issue
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_force_connector_basic@force-load-detect:
- fi-rkl-11600: NOTRUN -> [SKIP][13] ([fdo#109285] / [i915#4098])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_force_connector_basic@force-load-detect.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-rkl-11600: NOTRUN -> [SKIP][14] ([i915#4070] / [i915#533])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
* igt@kms_psr@primary_mmap_gtt:
- fi-rkl-11600: NOTRUN -> [SKIP][15] ([i915#1072]) +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_psr@primary_mmap_gtt.html
* igt@kms_setmode@basic-clone-single-crtc:
- fi-rkl-11600: NOTRUN -> [SKIP][16] ([i915#3555] / [i915#4098])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@kms_setmode@basic-clone-single-crtc.html
* igt@prime_vgem@basic-userptr:
- fi-rkl-11600: NOTRUN -> [SKIP][17] ([i915#3301] / [i915#3708])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@prime_vgem@basic-userptr.html
* igt@prime_vgem@basic-write:
- fi-rkl-11600: NOTRUN -> [SKIP][18] ([i915#3291] / [i915#3708]) +2 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-rkl-11600/igt@prime_vgem@basic-write.html
#### Possible fixes ####
* igt@core_hotunplug@unbind-rebind:
- {bat-rpls-2}: [DMESG-WARN][19] ([i915#4391]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6456/bat-rpls-2/igt@core_hotunplug@unbind-rebind.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/bat-rpls-2/igt@core_hotunplug@unbind-rebind.html
* igt@i915_selftest@live@hangcheck:
- fi-hsw-g3258: [INCOMPLETE][21] ([i915#4785]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6456/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html
- fi-snb-2600: [INCOMPLETE][23] ([i915#3921]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6456/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6456 -> IGTPW_7010
CI-20190529: 20190529
CI_DRM_11550: 56b089ae03ef8ea8ab7f474eaa70367898891ef0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7010: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/index.html
IGT_6456: c2b13bab06755aa47adc7c880fb52f41360099f3 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
+igt@gem_softpin@evict-single-offset
-igt@gem_softpin@allocator-evict-all-engines
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7010/index.html
[-- Attachment #2: Type: text/html, Size: 9705 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
2022-04-28 16:07 ` Kamil Konieczny
@ 2022-04-29 4:51 ` Zbigniew Kempczyński
0 siblings, 0 replies; 8+ messages in thread
From: Zbigniew Kempczyński @ 2022-04-29 4:51 UTC (permalink / raw)
To: Kamil Konieczny, igt-dev, Thomas Hellström
On Thu, Apr 28, 2022 at 06:07:50PM +0200, Kamil Konieczny wrote:
> Hi Zbigniew,
>
> On 2022-04-27 at 20:42:04 +0200, Zbigniew Kempczyński wrote:
> > Verify that eviction works when all engines try to use same offset for
> > different handles. It replaces allocator-evict-all-engines test because
> > it is simpler.
> >
> > v2: addressing review comments (Kamil)
> > v3: simplifying subtest (Chris)
> >
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > ---
> > tests/i915/gem_softpin.c | 76 ++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 74 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> > index 448b4c4b9e..7dae2a6c44 100644
> > --- a/tests/i915/gem_softpin.c
> > +++ b/tests/i915/gem_softpin.c
> > @@ -1073,6 +1073,77 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
> > igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> > }
> >
> > +#define MINIMAL_OFFSET 0x200000
> > +static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
> > + struct batch *batches, unsigned int count)
> > +{
> > + struct drm_i915_gem_exec_object2 obj = {
> > + .offset = max_t(uint64_t, gem_detect_safe_start_offset(fd), MINIMAL_OFFSET),
>
> imho this should be a parameter to this function, so it will be
> calculated once but you can leave it here, your choice.
Safe start offset is cached during first run so following calls returns
it from the cache, without further probing.
>
> > + .flags = EXEC_OBJECT_PINNED,
> > + };
> > +
> > + eb->buffers_ptr = to_user_pointer(&obj);
> > +
> > + for (unsigned int i = 0; i < count; i++) {
> > + obj.handle = batches[i].handle;
> > + gem_execbuf(fd, eb);
> > + }
> > +}
> > +
> > +static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
> > +{
> > + struct drm_i915_gem_execbuffer2 execbuf;
> > + struct intel_execution_engine2 *e;
> > + unsigned int engines[I915_EXEC_RING_MASK + 1];
> > + struct batch *batches;
> > + unsigned int nengine;
> > + unsigned int count;
> > + uint64_t size, batch_size = BATCH_SIZE;
> > +
> > + nengine = 0;
> > + for_each_ctx_engine(fd, ctx, e) {
> > + engines[nengine++] = e->flags;
> > + }
> > + igt_require(nengine);
> > +
> > + size = gem_aperture_size(fd);
> > + if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
> > + size = 1ull << 32;
> > + igt_require(size < (1ull<<32) * BATCH_SIZE);
> > +
> > + count = size / BATCH_SIZE + 1;
> > + igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
> > + count, (long long)size, nengine);
>
> Please add here print for timeout used and also change printing
> size to MB.
I understand you want to see this with --debug option? Ok, will add this
before merging.
>
> > +
> > + intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
> > + intel_detect_and_clear_missed_interrupts(fd);
> > +
> > + memset(&execbuf, 0, sizeof(execbuf));
> > + execbuf.buffer_count = 1;
> > + execbuf.rsvd1 = ctx->id;
> > +
> > + batches = calloc(count, sizeof(*batches));
> > + igt_assert(batches);
> > + for (unsigned int i = 0; i < count; i++)
> > + batches[i].handle = batch_create(fd, &batch_size);
> > +
> > + /* Flush all memory before we start the timer */
> > + single_offset_submit(fd, &execbuf, batches, count);
> > +
> > + igt_fork(child, nengine) {
> > + execbuf.flags |= engines[child];
> > + igt_until_timeout(timeout)
> > + single_offset_submit(fd, &execbuf, batches, count);
> > + }
> > + igt_waitchildren();
> > +
> > + for (unsigned int i = 0; i < count; i++)
> > + gem_close(fd, batches[i].handle);
> > + free(batches);
> > +
> > + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> > +}
> > +
> > static void make_batch(int i915, uint32_t handle, uint64_t size)
> > {
> > uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
> > @@ -1213,8 +1284,9 @@ igt_main
> > test_each_engine("allocator-evict", fd, ctx, e)
> > test_allocator_evict(fd, ctx, e->flags, 20);
> >
> > - igt_subtest("allocator-evict-all-engines")
> > - test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
> > + igt_describe("Use same offset for all engines and for different handles");
> > + igt_subtest("evict-single-offset")
> > + evict_single_offset(fd, ctx, 20);
>
> You are not using allocator here, so maybe move this down after
> evict-hog sibtest ?
Test need to be placed within 'gem_uses_full_ppgtt' group. We may argue
for the location, but I cannot move it outside it.
With above changes I'm going to take your r-b and merge.
--
Zbigniew
>
> With that small changes you can add my r-b tag.
>
> Regards,
> Kamil
> > }
> >
> > igt_describe("Check start offset and alignment detection");
> > --
> > 2.32.0
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
2022-04-27 18:42 [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines Zbigniew Kempczyński
@ 2022-04-28 16:07 ` Kamil Konieczny
2022-04-29 4:51 ` Zbigniew Kempczyński
0 siblings, 1 reply; 8+ messages in thread
From: Kamil Konieczny @ 2022-04-28 16:07 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Hellström
Hi Zbigniew,
On 2022-04-27 at 20:42:04 +0200, Zbigniew Kempczyński wrote:
> Verify that eviction works when all engines try to use same offset for
> different handles. It replaces allocator-evict-all-engines test because
> it is simpler.
>
> v2: addressing review comments (Kamil)
> v3: simplifying subtest (Chris)
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> ---
> tests/i915/gem_softpin.c | 76 ++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 74 insertions(+), 2 deletions(-)
>
> diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> index 448b4c4b9e..7dae2a6c44 100644
> --- a/tests/i915/gem_softpin.c
> +++ b/tests/i915/gem_softpin.c
> @@ -1073,6 +1073,77 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
> igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> }
>
> +#define MINIMAL_OFFSET 0x200000
> +static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
> + struct batch *batches, unsigned int count)
> +{
> + struct drm_i915_gem_exec_object2 obj = {
> + .offset = max_t(uint64_t, gem_detect_safe_start_offset(fd), MINIMAL_OFFSET),
imho this should be a parameter to this function, so it will be
calculated once but you can leave it here, your choice.
> + .flags = EXEC_OBJECT_PINNED,
> + };
> +
> + eb->buffers_ptr = to_user_pointer(&obj);
> +
> + for (unsigned int i = 0; i < count; i++) {
> + obj.handle = batches[i].handle;
> + gem_execbuf(fd, eb);
> + }
> +}
> +
> +static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
> +{
> + struct drm_i915_gem_execbuffer2 execbuf;
> + struct intel_execution_engine2 *e;
> + unsigned int engines[I915_EXEC_RING_MASK + 1];
> + struct batch *batches;
> + unsigned int nengine;
> + unsigned int count;
> + uint64_t size, batch_size = BATCH_SIZE;
> +
> + nengine = 0;
> + for_each_ctx_engine(fd, ctx, e) {
> + engines[nengine++] = e->flags;
> + }
> + igt_require(nengine);
> +
> + size = gem_aperture_size(fd);
> + if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
> + size = 1ull << 32;
> + igt_require(size < (1ull<<32) * BATCH_SIZE);
> +
> + count = size / BATCH_SIZE + 1;
> + igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
> + count, (long long)size, nengine);
Please add here print for timeout used and also change printing
size to MB.
> +
> + intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
> + intel_detect_and_clear_missed_interrupts(fd);
> +
> + memset(&execbuf, 0, sizeof(execbuf));
> + execbuf.buffer_count = 1;
> + execbuf.rsvd1 = ctx->id;
> +
> + batches = calloc(count, sizeof(*batches));
> + igt_assert(batches);
> + for (unsigned int i = 0; i < count; i++)
> + batches[i].handle = batch_create(fd, &batch_size);
> +
> + /* Flush all memory before we start the timer */
> + single_offset_submit(fd, &execbuf, batches, count);
> +
> + igt_fork(child, nengine) {
> + execbuf.flags |= engines[child];
> + igt_until_timeout(timeout)
> + single_offset_submit(fd, &execbuf, batches, count);
> + }
> + igt_waitchildren();
> +
> + for (unsigned int i = 0; i < count; i++)
> + gem_close(fd, batches[i].handle);
> + free(batches);
> +
> + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> +}
> +
> static void make_batch(int i915, uint32_t handle, uint64_t size)
> {
> uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
> @@ -1213,8 +1284,9 @@ igt_main
> test_each_engine("allocator-evict", fd, ctx, e)
> test_allocator_evict(fd, ctx, e->flags, 20);
>
> - igt_subtest("allocator-evict-all-engines")
> - test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
> + igt_describe("Use same offset for all engines and for different handles");
> + igt_subtest("evict-single-offset")
> + evict_single_offset(fd, ctx, 20);
You are not using allocator here, so maybe move this down after
evict-hog sibtest ?
With that small changes you can add my r-b tag.
Regards,
Kamil
> }
>
> igt_describe("Check start offset and alignment detection");
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
@ 2022-04-27 18:42 Zbigniew Kempczyński
2022-04-28 16:07 ` Kamil Konieczny
0 siblings, 1 reply; 8+ messages in thread
From: Zbigniew Kempczyński @ 2022-04-27 18:42 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Hellström
Verify that eviction works when all engines try to use same offset for
different handles. It replaces allocator-evict-all-engines test because
it is simpler.
v2: addressing review comments (Kamil)
v3: simplifying subtest (Chris)
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
tests/i915/gem_softpin.c | 76 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 74 insertions(+), 2 deletions(-)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 448b4c4b9e..7dae2a6c44 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -1073,6 +1073,77 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+#define MINIMAL_OFFSET 0x200000
+static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
+ struct batch *batches, unsigned int count)
+{
+ struct drm_i915_gem_exec_object2 obj = {
+ .offset = max_t(uint64_t, gem_detect_safe_start_offset(fd), MINIMAL_OFFSET),
+ .flags = EXEC_OBJECT_PINNED,
+ };
+
+ eb->buffers_ptr = to_user_pointer(&obj);
+
+ for (unsigned int i = 0; i < count; i++) {
+ obj.handle = batches[i].handle;
+ gem_execbuf(fd, eb);
+ }
+}
+
+static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
+{
+ struct drm_i915_gem_execbuffer2 execbuf;
+ struct intel_execution_engine2 *e;
+ unsigned int engines[I915_EXEC_RING_MASK + 1];
+ struct batch *batches;
+ unsigned int nengine;
+ unsigned int count;
+ uint64_t size, batch_size = BATCH_SIZE;
+
+ nengine = 0;
+ for_each_ctx_engine(fd, ctx, e) {
+ engines[nengine++] = e->flags;
+ }
+ igt_require(nengine);
+
+ size = gem_aperture_size(fd);
+ if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
+ size = 1ull << 32;
+ igt_require(size < (1ull<<32) * BATCH_SIZE);
+
+ count = size / BATCH_SIZE + 1;
+ igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
+ count, (long long)size, nengine);
+
+ intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ intel_detect_and_clear_missed_interrupts(fd);
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffer_count = 1;
+ execbuf.rsvd1 = ctx->id;
+
+ batches = calloc(count, sizeof(*batches));
+ igt_assert(batches);
+ for (unsigned int i = 0; i < count; i++)
+ batches[i].handle = batch_create(fd, &batch_size);
+
+ /* Flush all memory before we start the timer */
+ single_offset_submit(fd, &execbuf, batches, count);
+
+ igt_fork(child, nengine) {
+ execbuf.flags |= engines[child];
+ igt_until_timeout(timeout)
+ single_offset_submit(fd, &execbuf, batches, count);
+ }
+ igt_waitchildren();
+
+ for (unsigned int i = 0; i < count; i++)
+ gem_close(fd, batches[i].handle);
+ free(batches);
+
+ igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+}
+
static void make_batch(int i915, uint32_t handle, uint64_t size)
{
uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
@@ -1213,8 +1284,9 @@ igt_main
test_each_engine("allocator-evict", fd, ctx, e)
test_allocator_evict(fd, ctx, e->flags, 20);
- igt_subtest("allocator-evict-all-engines")
- test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
+ igt_describe("Use same offset for all engines and for different handles");
+ igt_subtest("evict-single-offset")
+ evict_single_offset(fd, ctx, 20);
}
igt_describe("Check start offset and alignment detection");
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
2022-04-05 18:28 ` Kamil Konieczny
@ 2022-04-27 6:03 ` Zbigniew Kempczyński
0 siblings, 0 replies; 8+ messages in thread
From: Zbigniew Kempczyński @ 2022-04-27 6:03 UTC (permalink / raw)
To: Kamil Konieczny, igt-dev, Thomas Hellström
On Tue, Apr 05, 2022 at 08:28:30PM +0200, Kamil Konieczny wrote:
> Hi Zbigniew,
>
> Dnia 2022-04-04 at 19:18:07 +0200, Zbigniew Kempczyński napisał(a):
> > Test verifies does eviction works when all engines try to use same
>
> s/Test verifies does/Verify that/
>
> > offset for different handles. It replaces allocator-evict-all-engines
> > test because it simpler version of it.
>
> s/test/subtest/
> s/because it simpler version of it./because it is simpler./
>
> >
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > ---
> > tests/i915/gem_softpin.c | 85 +++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 83 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> > index 34fc9983ff..5945317ed1 100644
> > --- a/tests/i915/gem_softpin.c
> > +++ b/tests/i915/gem_softpin.c
> > @@ -1072,6 +1072,87 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
> > igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> > }
> >
> > +static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
> > + struct batch *batches, unsigned int count)
> > +{
> > + struct drm_i915_gem_exec_object2 obj;
> > + uint64_t address = max_t(uint64_t, gem_detect_safe_start_offset(fd), 0x200000);
> ---------------------------------------------------------------------------- ^
> Shouldn't this be gem_detect_safe_alignment() ? Or #define and
> describe it with comment or add comment here.
No, in this subtest I want to reuse same offset. But I agree,
adding #define will make this constant more descriptive.
> Another idea whould be to calculate it in evict_single_offset
> before fork and pass it as parameter.
But this is "calculated" (probed) in gem_detect_safe_start_offset().
I don't want to be 0x0 as start offset so max_t() choose 2M offset
if minimal start offset is lesser than I want.
>
> > +
> > + memset(&obj, 0, sizeof(obj));
> > + obj.flags = EXEC_OBJECT_PINNED;
> > +
> > + for (unsigned int i = 0; i < count; i++) {
> > + obj.handle = batches[i].handle;
> > + obj.offset = address;
> > + eb->buffers_ptr = to_user_pointer(&obj);
> > + gem_execbuf(fd, eb);
> > + }
> > +}
> > +
> > +static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
> > +{
> > + struct drm_i915_gem_execbuffer2 execbuf;
> > + struct intel_execution_engine2 *e;
> > + unsigned int engines[I915_EXEC_RING_MASK + 1];
> > + struct batch *batches;
> > + unsigned int nengine;
> > + unsigned int count;
> > + uint64_t size;
> > +
> > + nengine = 0;
> > + for_each_ctx_engine(fd, ctx, e) {
> > + engines[nengine++] = e->flags;
> > + }
> > + igt_require(nengine);
> > +
> > + size = gem_aperture_size(fd);
> > + if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
> > + size = 1ull << 32;
> > + igt_require(size < (1ull<<32) * BATCH_SIZE);
> > +
> > + count = size / BATCH_SIZE + 1;
> > + igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
> > + count, (long long)size, nengine);
> > +
> > + intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
> > + intel_detect_and_clear_missed_interrupts(fd);
> > +
> > + memset(&execbuf, 0, sizeof(execbuf));
> > + execbuf.buffer_count = 1;
> > + execbuf.rsvd1 = ctx->id;
> > +
> > + batches = calloc(count, sizeof(*batches));
> > + igt_assert(batches);
> > + for (unsigned int i = 0; i < count; i++) {
> > + uint32_t *p;
> > +
> > + batches[i].handle = gem_create(fd, BATCH_SIZE);
> > + batches[i].ptr =
> > + gem_mmap__device_coherent(fd, batches[i].handle,
> > + 0, BATCH_SIZE, PROT_WRITE);
> > + p = batches[i].ptr + BATCH_SIZE - 8;
> > + *p = MI_BATCH_BUFFER_END;
> > + }
> > +
> > + /* Flush all memory before we start the timer */
> > + single_offset_submit(fd, &execbuf, batches, count);
> > +
> > + igt_fork(child, nengine) {
> > + execbuf.flags |= engines[child];
> > + igt_until_timeout(timeout)
> > + single_offset_submit(fd, &execbuf, batches, count);
> > + }
> > + igt_waitchildren();
> > +
> > + for (unsigned int i = 0; i < count; i++) {
> > + munmap(batches[i].ptr, BATCH_SIZE);
> > + gem_close(fd, batches[i].handle);
> > + }
> > + free(batches);
> > +
> > + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> > +}
> > +
> > static void make_batch(int i915, uint32_t handle, uint64_t size)
> > {
> > uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
> > @@ -1212,8 +1293,8 @@ igt_main
> > test_each_engine("allocator-evict", fd, ctx, e)
> > test_allocator_evict(fd, ctx, e->flags, 20);
> >
> > - igt_subtest("allocator-evict-all-engines")
> > - test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
> > + igt_subtest("evict-single-offset")
> > + evict_single_offset(fd, ctx, 20);
>
> While you change it please add description before subtest.
Ok, will be in v2.
--
Zbigniew
>
> Regards,
> Kamil
> > }
> >
> > igt_describe("Check start offset and alignment detection");
> > --
> > 2.32.0
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
2022-04-04 17:18 Zbigniew Kempczyński
@ 2022-04-05 18:28 ` Kamil Konieczny
2022-04-27 6:03 ` Zbigniew Kempczyński
0 siblings, 1 reply; 8+ messages in thread
From: Kamil Konieczny @ 2022-04-05 18:28 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Hellström
Hi Zbigniew,
Dnia 2022-04-04 at 19:18:07 +0200, Zbigniew Kempczyński napisał(a):
> Test verifies does eviction works when all engines try to use same
s/Test verifies does/Verify that/
> offset for different handles. It replaces allocator-evict-all-engines
> test because it simpler version of it.
s/test/subtest/
s/because it simpler version of it./because it is simpler./
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> ---
> tests/i915/gem_softpin.c | 85 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 83 insertions(+), 2 deletions(-)
>
> diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> index 34fc9983ff..5945317ed1 100644
> --- a/tests/i915/gem_softpin.c
> +++ b/tests/i915/gem_softpin.c
> @@ -1072,6 +1072,87 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
> igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> }
>
> +static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
> + struct batch *batches, unsigned int count)
> +{
> + struct drm_i915_gem_exec_object2 obj;
> + uint64_t address = max_t(uint64_t, gem_detect_safe_start_offset(fd), 0x200000);
---------------------------------------------------------------------------- ^
Shouldn't this be gem_detect_safe_alignment() ? Or #define and
describe it with comment or add comment here.
Another idea whould be to calculate it in evict_single_offset
before fork and pass it as parameter.
> +
> + memset(&obj, 0, sizeof(obj));
> + obj.flags = EXEC_OBJECT_PINNED;
> +
> + for (unsigned int i = 0; i < count; i++) {
> + obj.handle = batches[i].handle;
> + obj.offset = address;
> + eb->buffers_ptr = to_user_pointer(&obj);
> + gem_execbuf(fd, eb);
> + }
> +}
> +
> +static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
> +{
> + struct drm_i915_gem_execbuffer2 execbuf;
> + struct intel_execution_engine2 *e;
> + unsigned int engines[I915_EXEC_RING_MASK + 1];
> + struct batch *batches;
> + unsigned int nengine;
> + unsigned int count;
> + uint64_t size;
> +
> + nengine = 0;
> + for_each_ctx_engine(fd, ctx, e) {
> + engines[nengine++] = e->flags;
> + }
> + igt_require(nengine);
> +
> + size = gem_aperture_size(fd);
> + if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
> + size = 1ull << 32;
> + igt_require(size < (1ull<<32) * BATCH_SIZE);
> +
> + count = size / BATCH_SIZE + 1;
> + igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
> + count, (long long)size, nengine);
> +
> + intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
> + intel_detect_and_clear_missed_interrupts(fd);
> +
> + memset(&execbuf, 0, sizeof(execbuf));
> + execbuf.buffer_count = 1;
> + execbuf.rsvd1 = ctx->id;
> +
> + batches = calloc(count, sizeof(*batches));
> + igt_assert(batches);
> + for (unsigned int i = 0; i < count; i++) {
> + uint32_t *p;
> +
> + batches[i].handle = gem_create(fd, BATCH_SIZE);
> + batches[i].ptr =
> + gem_mmap__device_coherent(fd, batches[i].handle,
> + 0, BATCH_SIZE, PROT_WRITE);
> + p = batches[i].ptr + BATCH_SIZE - 8;
> + *p = MI_BATCH_BUFFER_END;
> + }
> +
> + /* Flush all memory before we start the timer */
> + single_offset_submit(fd, &execbuf, batches, count);
> +
> + igt_fork(child, nengine) {
> + execbuf.flags |= engines[child];
> + igt_until_timeout(timeout)
> + single_offset_submit(fd, &execbuf, batches, count);
> + }
> + igt_waitchildren();
> +
> + for (unsigned int i = 0; i < count; i++) {
> + munmap(batches[i].ptr, BATCH_SIZE);
> + gem_close(fd, batches[i].handle);
> + }
> + free(batches);
> +
> + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> +}
> +
> static void make_batch(int i915, uint32_t handle, uint64_t size)
> {
> uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
> @@ -1212,8 +1293,8 @@ igt_main
> test_each_engine("allocator-evict", fd, ctx, e)
> test_allocator_evict(fd, ctx, e->flags, 20);
>
> - igt_subtest("allocator-evict-all-engines")
> - test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
> + igt_subtest("evict-single-offset")
> + evict_single_offset(fd, ctx, 20);
While you change it please add description before subtest.
Regards,
Kamil
> }
>
> igt_describe("Check start offset and alignment detection");
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines
@ 2022-04-04 17:18 Zbigniew Kempczyński
2022-04-05 18:28 ` Kamil Konieczny
0 siblings, 1 reply; 8+ messages in thread
From: Zbigniew Kempczyński @ 2022-04-04 17:18 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Hellström
Test verifies does eviction works when all engines try to use same
offset for different handles. It replaces allocator-evict-all-engines
test because it simpler version of it.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
tests/i915/gem_softpin.c | 85 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 83 insertions(+), 2 deletions(-)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 34fc9983ff..5945317ed1 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -1072,6 +1072,87 @@ static void test_allocator_evict(int fd, const intel_ctx_t *ctx,
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+static void single_offset_submit(int fd, struct drm_i915_gem_execbuffer2 *eb,
+ struct batch *batches, unsigned int count)
+{
+ struct drm_i915_gem_exec_object2 obj;
+ uint64_t address = max_t(uint64_t, gem_detect_safe_start_offset(fd), 0x200000);
+
+ memset(&obj, 0, sizeof(obj));
+ obj.flags = EXEC_OBJECT_PINNED;
+
+ for (unsigned int i = 0; i < count; i++) {
+ obj.handle = batches[i].handle;
+ obj.offset = address;
+ eb->buffers_ptr = to_user_pointer(&obj);
+ gem_execbuf(fd, eb);
+ }
+}
+
+static void evict_single_offset(int fd, const intel_ctx_t *ctx, int timeout)
+{
+ struct drm_i915_gem_execbuffer2 execbuf;
+ struct intel_execution_engine2 *e;
+ unsigned int engines[I915_EXEC_RING_MASK + 1];
+ struct batch *batches;
+ unsigned int nengine;
+ unsigned int count;
+ uint64_t size;
+
+ nengine = 0;
+ for_each_ctx_engine(fd, ctx, e) {
+ engines[nengine++] = e->flags;
+ }
+ igt_require(nengine);
+
+ size = gem_aperture_size(fd);
+ if (size > 1ull<<32) /* Limit to 4GiB as we do not use allow-48b */
+ size = 1ull << 32;
+ igt_require(size < (1ull<<32) * BATCH_SIZE);
+
+ count = size / BATCH_SIZE + 1;
+ igt_debug("Using %'d batches to fill %'llu aperture on %d engines\n",
+ count, (long long)size, nengine);
+
+ intel_require_memory(count, BATCH_SIZE, CHECK_RAM);
+ intel_detect_and_clear_missed_interrupts(fd);
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffer_count = 1;
+ execbuf.rsvd1 = ctx->id;
+
+ batches = calloc(count, sizeof(*batches));
+ igt_assert(batches);
+ for (unsigned int i = 0; i < count; i++) {
+ uint32_t *p;
+
+ batches[i].handle = gem_create(fd, BATCH_SIZE);
+ batches[i].ptr =
+ gem_mmap__device_coherent(fd, batches[i].handle,
+ 0, BATCH_SIZE, PROT_WRITE);
+ p = batches[i].ptr + BATCH_SIZE - 8;
+ *p = MI_BATCH_BUFFER_END;
+ }
+
+ /* Flush all memory before we start the timer */
+ single_offset_submit(fd, &execbuf, batches, count);
+
+ igt_fork(child, nengine) {
+ execbuf.flags |= engines[child];
+ igt_until_timeout(timeout)
+ single_offset_submit(fd, &execbuf, batches, count);
+ }
+ igt_waitchildren();
+
+ for (unsigned int i = 0; i < count; i++) {
+ munmap(batches[i].ptr, BATCH_SIZE);
+ gem_close(fd, batches[i].handle);
+ }
+ free(batches);
+
+ igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+}
+
static void make_batch(int i915, uint32_t handle, uint64_t size)
{
uint32_t *bb = gem_mmap__device_coherent(i915, handle, 0, size, PROT_WRITE);
@@ -1212,8 +1293,8 @@ igt_main
test_each_engine("allocator-evict", fd, ctx, e)
test_allocator_evict(fd, ctx, e->flags, 20);
- igt_subtest("allocator-evict-all-engines")
- test_allocator_evict(fd, ctx, ALL_ENGINES, 20);
+ igt_subtest("evict-single-offset")
+ evict_single_offset(fd, ctx, 20);
}
igt_describe("Check start offset and alignment detection");
--
2.32.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-04-29 4:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 6:10 [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines Zbigniew Kempczyński
2022-04-27 6:52 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_softpin: Exercise single offset eviction on all engines (rev2) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-04-27 18:42 [igt-dev] [PATCH i-g-t] tests/i915/gem_softpin: Exercise single offset eviction on all engines Zbigniew Kempczyński
2022-04-28 16:07 ` Kamil Konieczny
2022-04-29 4:51 ` Zbigniew Kempczyński
2022-04-04 17:18 Zbigniew Kempczyński
2022-04-05 18:28 ` Kamil Konieczny
2022-04-27 6:03 ` Zbigniew Kempczyński
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.