All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
@ 2017-12-12 21:43 Chris Wilson
  2017-12-12 22:37 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2017-12-12 21:43 UTC (permalink / raw)
  To: intel-gfx

Having discovered that we would encounter an indefinite wait in the
shrinker within execbuf/request construction, try to exercise that path
by emitting lots of execbuf with fences (which require allocation inside
request construction) whilst under severe mempressure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_shrink.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tests/gem_shrink.c b/tests/gem_shrink.c
index 06f7a3012..d39fe3cfe 100644
--- a/tests/gem_shrink.c
+++ b/tests/gem_shrink.c
@@ -36,6 +36,8 @@
 #define MADV_FREE 8
 #endif
 
+static unsigned int engines[16], nengine;
+
 static void get_pages(int fd, uint64_t alloc)
 {
 	uint32_t handle = gem_create(fd, alloc);
@@ -150,6 +152,37 @@ static void execbufN(int fd, uint64_t alloc)
 	munmap(obj, obj_size);
 }
 
+static void execbufX(int fd, uint64_t alloc)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	struct drm_i915_gem_exec_object2 *obj;
+	struct drm_i915_gem_execbuffer2 execbuf;
+	int count = alloc >> 20;
+	uint64_t obj_size;
+
+	obj = __gem_calloc(fd, alloc + 1, sizeof(*obj), &obj_size);
+	memset(&execbuf, 0, sizeof(execbuf));
+
+	obj[count].handle = gem_create(fd, 4096);
+	gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe));
+
+	for (int i = 1; i <= count; i++) {
+		int j = count - i;
+
+		obj[j].handle = gem_create(fd, 1 << 20);
+		obj[j].flags = EXEC_OBJECT_WRITE;
+
+		execbuf.buffers_ptr = to_user_pointer(&obj[j]);
+		execbuf.buffer_count = i + 1;
+		execbuf.flags = engines[j % nengine];
+		gem_execbuf(fd, &execbuf);
+	}
+
+	for (int i = 0; i <= count; i++)
+		gem_madvise(fd, obj[i].handle, I915_MADV_DONTNEED);
+	munmap(obj, obj_size);
+}
+
 static void hang(int fd, uint64_t alloc)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
@@ -344,6 +377,7 @@ igt_main
 		{ "mmap-cpu", mmap_cpu },
 		{ "execbuf1", execbuf1 },
 		{ "execbufN", execbufN },
+		{ "execbufX", execbufX },
 		{ "hang", hang },
 		{ NULL },
 	};
@@ -364,6 +398,8 @@ igt_main
 
 	igt_fixture {
 		uint64_t mem_size = intel_get_total_ram_mb();
+		unsigned int engine;
+		int fd;
 
 		/* Spawn enough processes to use all memory, but each only
 		 * uses half the available mappable aperture ~128MiB.
@@ -379,6 +415,16 @@ igt_main
 
 		intel_require_memory(num_processes, alloc_size,
 				     CHECK_SWAP | CHECK_RAM);
+
+		fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(fd);
+
+		nengine = 0;
+		for_each_engine(fd, engine)
+			engines[nengine++] = engine;
+		igt_require(nengine);
+
+		close(fd);
 	}
 
 	igt_subtest("reclaim")
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* ✓ Fi.CI.BAT: success for igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
  2017-12-12 21:43 [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure Chris Wilson
@ 2017-12-12 22:37 ` Patchwork
  2017-12-13  0:03 ` ✗ Fi.CI.IGT: warning " Patchwork
  2017-12-13 11:30 ` [PATCH igt] " Joonas Lahtinen
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-12-12 22:37 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
URL   : https://patchwork.freedesktop.org/series/35250/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
74407418720ff7a9de7caabec05d4c3afe9a5c51 igt/kms_flip: Allow very large bo to fail pageflips with E2BIG

with latest DRM-Tip kernel build CI_DRM_3503
8874c0f95698 drm-tip: 2017y-12m-12d-21h-34m-33s UTC integration manifest

Testlist changes:
+igt@gem_shrink@execbufx
+igt@gem_shrink@execbufx-oom
+igt@gem_shrink@execbufx-sanitycheck
+igt@gem_shrink@execbufx-userptr

Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-kbl-r) fdo#104172 +1

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104172 https://bugs.freedesktop.org/show_bug.cgi?id=104172

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:442s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:442s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:384s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:524s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:506s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:507s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:491s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:472s
fi-elk-e7500     total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 time:271s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:540s
fi-hsw-4770r     total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  time:258s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:399s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-ivb-3770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:449s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:486s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:533s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:471s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:531s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:586s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:447s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:539s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-skl-6700k     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:515s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:496s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:451s
fi-snb-2520m     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:551s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:416s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:603s
fi-glk-dsi       total:288  pass:175  dwarn:1   dfail:4   fail:0   skip:108 time:336s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_659/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* ✗ Fi.CI.IGT: warning for igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
  2017-12-12 21:43 [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure Chris Wilson
  2017-12-12 22:37 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-12-13  0:03 ` Patchwork
  2017-12-13 11:30 ` [PATCH igt] " Joonas Lahtinen
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-12-13  0:03 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
URL   : https://patchwork.freedesktop.org/series/35250/
State : warning

== Summary ==

Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb565-draw-pwrite:
                pass       -> SKIP       (shard-snb) fdo#101623 +1
Test gem_mmap_wc:
        Subgroup set-cache-level:
                pass       -> SKIP       (shard-snb)
Test gem_tiled_swapping:
        Subgroup non-threaded:
                incomplete -> PASS       (shard-snb) fdo#104009
Test gem_softpin:
        Subgroup noreloc-s3:
                pass       -> SKIP       (shard-snb) fdo#102365
                pass       -> SKIP       (shard-hsw) fdo#103540
Test gem_pwrite:
        Subgroup huge-gtt-backwards:
                incomplete -> PASS       (shard-hsw)

fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#104009 https://bugs.freedesktop.org/show_bug.cgi?id=104009
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540

shard-hsw        total:2712 pass:1536 dwarn:1   dfail:0   fail:10  skip:1165 time:9457s
shard-snb        total:2712 pass:1306 dwarn:1   dfail:0   fail:12  skip:1393 time:7970s
Blacklisted hosts:
shard-apl        total:2712 pass:1688 dwarn:1   dfail:0   fail:22  skip:1001 time:14032s
shard-kbl        total:2712 pass:1767 dwarn:38  dfail:3   fail:25  skip:879 time:11090s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_659/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
  2017-12-12 21:43 [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure Chris Wilson
  2017-12-12 22:37 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-12-13  0:03 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2017-12-13 11:30 ` Joonas Lahtinen
  2017-12-13 11:42   ` Chris Wilson
  2 siblings, 1 reply; 5+ messages in thread
From: Joonas Lahtinen @ 2017-12-13 11:30 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Tue, 2017-12-12 at 21:43 +0000, Chris Wilson wrote:
> Having discovered that we would encounter an indefinite wait in the
> shrinker within execbuf/request construction, try to exercise that path
> by emitting lots of execbuf with fences (which require allocation inside
> request construction) whilst under severe mempressure.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Mostly surprised we didn't have this test already :)

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure
  2017-12-13 11:30 ` [PATCH igt] " Joonas Lahtinen
@ 2017-12-13 11:42   ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-12-13 11:42 UTC (permalink / raw)
  To: Joonas Lahtinen, intel-gfx

Quoting Joonas Lahtinen (2017-12-13 11:30:22)
> On Tue, 2017-12-12 at 21:43 +0000, Chris Wilson wrote:
> > Having discovered that we would encounter an indefinite wait in the
> > shrinker within execbuf/request construction, try to exercise that path
> > by emitting lots of execbuf with fences (which require allocation inside
> > request construction) whilst under severe mempressure.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> Mostly surprised we didn't have this test already :)

I dread how little we probably have coverage for. (Back to dreaming
about injecting code via bpf and fuzzing.)

> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Ta,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-13 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 21:43 [PATCH igt] igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressure Chris Wilson
2017-12-12 22:37 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-13  0:03 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-12-13 11:30 ` [PATCH igt] " Joonas Lahtinen
2017-12-13 11:42   ` Chris Wilson

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.