Skip to contentSkip to conversation

tests/xe_create: Add multiple engines create/destroy subtest

PATCH In review Zbigniew Kempczyński 3 participants 5 messages Jun 12, 2023 – Jun 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 tests/xe_create: Add multiple engines create/destroy subtest

Exercise basic engine concurrency create/destroy functionality.

---

v2: use different random seeds in children to avoid same engine
pattern selection (Kamil)
check execution time and report failure if it's too long (Kamil)
v3: drop variable (Kamil)

---
 tests/xe/xe_create.c | 103 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
tests/xe/xe_create.c +103 -0
index ae21154646..b427c51fd5 100644
@@ -88,6 +88,103 @@ static void create_invalid_size(int fd)
 	xe_vm_destroy(fd, vm);
 }
 
+enum engine_destroy {
+	NOLEAK,
+	LEAK
+};
+
+static uint32_t __xe_engine_create(int fd, uint32_t vm,
+				   struct drm_xe_engine_class_instance *instance,
+				   uint64_t ext,
+				   uint32_t *enginep)
+{
+	struct drm_xe_engine_create create = {
+		.extensions = ext,
+		.vm_id = vm,
+		.width = 1,
+		.num_placements = 1,
+		.instances = to_user_pointer(instance),
+	};
+	int err = 0;
+
+	if (igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE, &create) == 0) {
+		*enginep = create.engine_id;
+	} else {
+		igt_warn("Can't create engine, errno: %d\n", errno);
+		err = -errno;
+		igt_assume(err);
+	}
+	errno = 0;
+
+	return err;
+}
+
+#define MAXENGINES 2048
+#define MAXTIME 2
+
+/**
+ * SUBTEST: create-engines-%s
+ * Description: Check process ability of multiple engines creation
+ * Run type: FULL
+ *
+ * arg[1]:
+ *
+ * @noleak:				destroy engines in the code
+ * @leak:				destroy engines in close() path
+ */
+static void create_engines(int fd, enum engine_destroy ed)
+{
+	struct timespec tv = { };
+	uint32_t num_engines, engines_per_process, vm;
+	int nproc = sysconf(_SC_NPROCESSORS_ONLN), seconds;
+
+	fd = drm_reopen_driver(fd);
+	num_engines = xe_number_hw_engines(fd);
+	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
+
+	engines_per_process = max_t(uint32_t, 1, MAXENGINES / nproc);
+	igt_debug("nproc: %u, engines per process: %u\n", nproc, engines_per_process);
+
+	igt_nsec_elapsed(&tv);
+
+	igt_fork(n, nproc) {
+		struct drm_xe_engine_class_instance *hwe;
+		uint32_t engine, engines[engines_per_process];
+		int idx, err, i;
+
+		srandom(n);
+
+		for (i = 0; i < engines_per_process; i++) {
+			idx = rand() % num_engines;
+			hwe = xe_hw_engine(fd, idx);
+			err = __xe_engine_create(fd, vm, hwe, 0, &engine);
+			igt_debug("[%2d] Create engine: err=%d, engine=%u [idx = %d]\n",
+				  n, err, engine, i);
+			if (err)
+				break;
+
+			if (ed == NOLEAK)
+				engines[i] = engine;
+		}
+
+		if (ed == NOLEAK) {
+			while (--i >= 0) {
+				igt_debug("[%2d] Destroy engine: %u\n", n, engines[i]);
+				xe_engine_destroy(fd, engines[i]);
+			}
+		}
+	}
+	igt_waitchildren();
+
+	xe_vm_destroy(fd, vm);
+	close(fd);
+
+	seconds = igt_seconds_elapsed(&tv);
+	igt_assert_f(seconds < MAXTIME,
+		     "Creating %d engines tooks too long: %d [limit: %d]\n",
+		     MAXENGINES, seconds, MAXTIME);
+}
+
 /**
  * SUBTEST: create-massive-size
  * Description: Verifies xe bo create returns expected error code on massive
@@ -121,6 +218,12 @@ igt_main
 		create_invalid_size(xe);
 	}
 
+	igt_subtest("create-engines-noleak")
+		create_engines(xe, NOLEAK);
+
+	igt_subtest("create-engines-leak")
+		create_engines(xe, LEAK);
+
 	igt_subtest("create-massive-size") {
 		create_massive_size(xe);
 	}
Signature · 1 line
2.34.1
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for tests/xe_create: Add multiple engines create/destroy subtest (rev4)

== Series Details ==

== Series Details ==

Series: tests/xe_create: Add multiple engines create/destroy subtest (rev4)
URL : https://patchwork.freedesktop.org/series/118931/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13260 -> IGTPW_9146
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html

Participating hosts (34 -> 35)
------------------------------

Additional (1): bat-atsm-1

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_9146:

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_exec_parallel@engines@userptr:
- {bat-mtlp-6}: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-mtlp-6/igt@gem_exec_parallel@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-mtlp-6/igt@gem_exec_parallel@[email protected]

Known issues
------------

Here are the changes found in IGTPW_9146 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_mmap@basic:
- bat-atsm-1: NOTRUN -> [SKIP][3] ([i915#4083])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@gem_tiled_fence_blits@basic:
- bat-atsm-1: NOTRUN -> [SKIP][4] ([i915#4077]) +2 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@gem_tiled_pread_basic:
- bat-atsm-1: NOTRUN -> [SKIP][5] ([i915#4079]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@gem_tiled_pread_basic.html

* igt@i915_pm_rps@basic-api:
- bat-atsm-1: NOTRUN -> [SKIP][6] ([i915#6621])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@i915_selftest@live@reset:
- bat-rpls-1: [PASS][7] -> [ABORT][8] ([i915#4983] / [i915#7461] / [i915#8347] / [i915#8384])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-rpls-1/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][9] ([i915#6367])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][10] ([i915#6687])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-rpls-2/igt@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-atsm-1: NOTRUN -> [SKIP][11] ([i915#6645])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_addfb_basic@size-max:
- bat-atsm-1: NOTRUN -> [SKIP][12] ([i915#6077]) +36 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- bat-atsm-1: NOTRUN -> [SKIP][13] ([i915#6078]) +19 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_flip@basic-plain-flip:
- bat-atsm-1: NOTRUN -> [SKIP][14] ([i915#6166]) +3 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- bat-atsm-1: NOTRUN -> [SKIP][15] ([i915#6093]) +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc:
- bat-atsm-1: NOTRUN -> [SKIP][16] ([i915#1836]) +6 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1:
- bat-dg2-8: [PASS][17] -> [FAIL][18] ([i915#7932])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_prop_blob@basic:
- bat-atsm-1: NOTRUN -> [SKIP][19] ([i915#7357])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- bat-atsm-1: NOTRUN -> [SKIP][20] ([i915#1072]) +3 similar issues
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_setmode@basic-clone-single-crtc:
- bat-atsm-1: NOTRUN -> [SKIP][21] ([i915#6094])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- bat-atsm-1: NOTRUN -> [SKIP][22] ([fdo#109295] / [i915#6078])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-fence-mmap:
- bat-atsm-1: NOTRUN -> [SKIP][23] ([fdo#109295] / [i915#4077]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-write:
- bat-atsm-1: NOTRUN -> [SKIP][24] ([fdo#109295]) +2 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-atsm-1/igt@[email protected]

#### Possible fixes ####

* igt@core_auth@basic-auth:
- {bat-adlp-11}: [ABORT][25] ([i915#8011]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-adlp-11/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-adlp-11/igt@[email protected]

* igt@i915_module_load@load:
- {bat-adlp-11}: [DMESG-WARN][27] ([i915#4423]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-adlp-11/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-adlp-11/igt@[email protected]

* igt@i915_selftest@live@migrate:
- {bat-mtlp-8}: [DMESG-FAIL][29] ([i915#7699]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-mtlp-8/igt@i915_selftest@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-mtlp-8/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@requests:
- bat-rpls-2: [ABORT][31] ([i915#7913] / [i915#7982]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-rpls-2/igt@i915_selftest@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- {bat-mtlp-6}: [DMESG-WARN][33] ([i915#6367]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/bat-mtlp-6/igt@i915_selftest@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/bat-mtlp-6/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1836]: https://gitlab.freedesktop.org/drm/intel/issues/1836
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4093]: https://gitlab.freedesktop.org/drm/intel/issues/4093
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4309]: https://gitlab.freedesktop.org/drm/intel/issues/4309
[i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6077]: https://gitlab.freedesktop.org/drm/intel/issues/6077
[i915#6078]: https://gitlab.freedesktop.org/drm/intel/issues/6078
[i915#6093]: https://gitlab.freedesktop.org/drm/intel/issues/6093
[i915#6094]: https://gitlab.freedesktop.org/drm/intel/issues/6094
[i915#6166]: https://gitlab.freedesktop.org/drm/intel/issues/6166
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#7357]: https://gitlab.freedesktop.org/drm/intel/issues/7357
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7325 -> IGTPW_9146

CI-20190529: 20190529
CI_DRM_13260: 4af4f7bbadd137c4718545adeecc1b98f4475393 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9146: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html
IGT_7325: 17fbab44f3ce578011e74a9de99884e32a133b25 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

+igt@xe_create@create-engines-leak
+igt@xe_create@create-engines-noleak

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for tests/xe_create: Add multiple engines create/destroy subtest (rev4)

In reply to Zbigniew Kempczyński
== Series Details ==

== Series Details ==

Series: tests/xe_create: Add multiple engines create/destroy subtest (rev4)
URL : https://patchwork.freedesktop.org/series/118931/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13260_full -> IGTPW_9146_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html

Participating hosts (8 -> 7)
------------------------------

Missing (1): shard-rkl0

Known issues
------------

Here are the changes found in IGTPW_9146_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_freq_api@freq-basic-api:
- shard-apl: NOTRUN -> [SKIP][1] ([fdo#109271]) +3 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-apl2/igt@[email protected]

* igt@i915_pm_rpm@i2c:
- shard-glk: [PASS][2] -> [FAIL][3] ([i915#5466])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk4/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk7/igt@[email protected]

* igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1:
- shard-apl: [PASS][4] -> [ABORT][5] ([i915#180])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-apl4/igt@kms_cursor_crc@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-apl2/igt@kms_cursor_crc@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-glk: [PASS][6] -> [FAIL][7] ([i915#2346])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk5/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk8/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank@b-hdmi-a2:
- shard-glk: [PASS][8] -> [FAIL][9] ([i915#2122])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk9/igt@kms_flip@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk5/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2:
- shard-glk: [PASS][10] -> [FAIL][11] ([i915#79])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk7/igt@kms_flip@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk9/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-render:
- shard-snb: [PASS][12] -> [SKIP][13] ([fdo#109271]) +2 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-snb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-render.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-snb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-render.html

* igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-render:
- shard-glk: NOTRUN -> [SKIP][14] ([fdo#109271]) +1 similar issue
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk2/igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-render.html

* igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-a-vga-1:
- shard-snb: NOTRUN -> [SKIP][15] ([fdo#109271]) +17 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-snb7/igt@kms_plane_scaling@[email protected]

* igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-hdmi-a-1:
- shard-snb: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4579]) +12 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-snb1/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-hdmi-a-1.html

* igt@kms_setmode@basic@pipe-a-hdmi-a-1:
- shard-snb: NOTRUN -> [FAIL][17] ([i915#5465]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-snb1/igt@kms_setmode@[email protected]

#### Possible fixes ####

* igt@drm_fdinfo@most-busy-check-all@rcs0:
- {shard-rkl}: [FAIL][18] ([i915#7742]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-rkl-6/igt@drm_fdinfo@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-rkl-7/igt@drm_fdinfo@[email protected]

* igt@gem_barrier_race@remote-request@rcs0:
- {shard-tglu}: [ABORT][20] ([i915#8211] / [i915#8234]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-tglu-4/igt@gem_barrier_race@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-tglu-9/igt@gem_barrier_race@[email protected]

* igt@gem_ctx_exec@basic-nohangcheck:
- {shard-rkl}: [FAIL][22] ([i915#6268]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-rkl-4/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-rkl-7/igt@[email protected]

* igt@gem_eio@hibernate:
- {shard-dg1}: [ABORT][24] ([i915#4391] / [i915#7975] / [i915#8213]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-dg1-14/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-dg1-16/igt@[email protected]

* igt@gem_eio@reset-stress:
- {shard-dg1}: [FAIL][26] ([i915#5784]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-dg1-15/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-dg1-14/igt@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- {shard-tglu}: [FAIL][28] ([i915#2842]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-tglu-8/igt@gem_exec_fair@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-tglu-8/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@rcs0:
- {shard-rkl}: [FAIL][30] ([i915#2842]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-rkl-4/igt@gem_exec_fair@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-rkl-4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs0:
- shard-glk: [FAIL][32] ([i915#2842]) -> [PASS][33] +1 similar issue
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk8/igt@gem_exec_fair@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_suspend@basic-s4-devices@smem:
- {shard-tglu}: [ABORT][34] ([i915#7975] / [i915#8213]) -> [PASS][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-tglu-10/igt@gem_exec_suspend@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-tglu-3/igt@gem_exec_suspend@[email protected]

* igt@gen9_exec_parse@allowed-single:
- shard-apl: [ABORT][36] ([i915#5566]) -> [PASS][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-apl2/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-apl1/igt@[email protected]

* igt@i915_pm_dc@dc6-dpms:
- {shard-tglu}: [FAIL][38] ([i915#3989] / [i915#454]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-tglu-10/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-tglu-10/igt@[email protected]

* igt@i915_pm_dc@dc9-dpms:
- shard-apl: [SKIP][40] ([fdo#109271]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-apl2/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-apl4/igt@[email protected]

* igt@i915_pm_rpm@dpms-mode-unset-lpsp:
- {shard-rkl}: [SKIP][42] ([i915#1397]) -> [PASS][43] +1 similar issue
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-rkl-1/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-rkl-7/igt@[email protected]

* igt@i915_pm_rpm@modeset-non-lpsp-stress-no-wait:
- {shard-dg1}: [SKIP][44] ([i915#1397]) -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-dg1-19/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-dg1-16/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip@pipe-c-hdmi-a-1:
- shard-glk: [FAIL][46] ([i915#2521]) -> [PASS][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk4/igt@kms_async_flips@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk3/igt@kms_async_flips@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-glk: [FAIL][48] ([i915#2346]) -> [PASS][49]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-glk4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-glk2/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_cursor_legacy@single-move@pipe-b:
- {shard-dg1}: [INCOMPLETE][50] ([i915#8011] / [i915#8347]) -> [PASS][51] +1 similar issue
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-dg1-19/igt@kms_cursor_legacy@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-dg1-15/igt@kms_cursor_legacy@[email protected]

* igt@perf_pmu@all-busy-idle-check-all:
- {shard-dg1}: [FAIL][52] ([i915#5234]) -> [PASS][53]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-dg1-18/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-dg1-15/igt@[email protected]

#### Warnings ####

* igt@kms_content_protection@lic:
- shard-snb: [SKIP][54] ([fdo#109271] / [i915#4579]) -> [SKIP][55] ([fdo#109271])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13260/shard-snb7/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/shard-snb2/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5234]: https://gitlab.freedesktop.org/drm/intel/issues/5234
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5465]: https://gitlab.freedesktop.org/drm/intel/issues/5465
[i915#5466]: https://gitlab.freedesktop.org/drm/intel/issues/5466
[i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6412]: https://gitlab.freedesktop.org/drm/intel/issues/6412
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211
[i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
[i915#8228]: https://gitlab.freedesktop.org/drm/intel/issues/8228
[i915#8234]: https://gitlab.freedesktop.org/drm/intel/issues/8234
[i915#8247]: https://gitlab.freedesktop.org/drm/intel/issues/8247
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
[i915#8304]: https://gitlab.freedesktop.org/drm/intel/issues/8304
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8414]: https://gitlab.freedesktop.org/drm/intel/issues/8414
[i915#8502]: https://gitlab.freedesktop.org/drm/intel/issues/8502

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7325 -> IGTPW_9146
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_13260: 4af4f7bbadd137c4718545adeecc1b98f4475393 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9146: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html
IGT_7325: 17fbab44f3ce578011e74a9de99884e32a133b25 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9146/index.html

#3 lore raw
In reply to Zbigniew Kempczyński

Hi Zbigniew,

Quoted 107 lines · Zbigniew Kempczyński

Exercise basic engine concurrency create/destroy functionality.

---

v2: use different random seeds in children to avoid same engine
pattern selection (Kamil)
check execution time and report failure if it's too long (Kamil)
v3: drop variable (Kamil)

---
 tests/xe/xe_create.c | 103 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
tests/xe/xe_create.c +85 -0
index ae21154646..b427c51fd5 100644
@@ -88,6 +88,103 @@ static void create_invalid_size(int fd)
 	xe_vm_destroy(fd, vm);
 }
 
+enum engine_destroy {
+	NOLEAK,
+	LEAK
+};
+
+static uint32_t __xe_engine_create(int fd, uint32_t vm,
+				   struct drm_xe_engine_class_instance *instance,
+				   uint64_t ext,
+				   uint32_t *enginep)
+{
+	struct drm_xe_engine_create create = {
+		.extensions = ext,
+		.vm_id = vm,
+		.width = 1,
+		.num_placements = 1,
+		.instances = to_user_pointer(instance),
+	};
+	int err = 0;
+
+	if (igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE, &create) == 0) {
+		*enginep = create.engine_id;
+	} else {
+		igt_warn("Can't create engine, errno: %d\n", errno);
+		err = -errno;
+		igt_assume(err);
+	}
+	errno = 0;
+
+	return err;
+}
+
+#define MAXENGINES 2048
+#define MAXTIME 2
+
+/**
+ * SUBTEST: create-engines-%s
+ * Description: Check process ability of multiple engines creation
+ * Run type: FULL
+ *
+ * arg[1]:
+ *
+ * @noleak:				destroy engines in the code
+ * @leak:				destroy engines in close() path
+ */
+static void create_engines(int fd, enum engine_destroy ed)
+{
+	struct timespec tv = { };
+	uint32_t num_engines, engines_per_process, vm;
+	int nproc = sysconf(_SC_NPROCESSORS_ONLN), seconds;
+
+	fd = drm_reopen_driver(fd);
+	num_engines = xe_number_hw_engines(fd);
+	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
+
+	engines_per_process = max_t(uint32_t, 1, MAXENGINES / nproc);
+	igt_debug("nproc: %u, engines per process: %u\n", nproc, engines_per_process);
+
+	igt_nsec_elapsed(&tv);
+
+	igt_fork(n, nproc) {
+		struct drm_xe_engine_class_instance *hwe;
+		uint32_t engine, engines[engines_per_process];
+		int idx, err, i;
+
+		srandom(n);
+
+		for (i = 0; i < engines_per_process; i++) {
+			idx = rand() % num_engines;
+			hwe = xe_hw_engine(fd, idx);
+			err = __xe_engine_create(fd, vm, hwe, 0, &engine);
+			igt_debug("[%2d] Create engine: err=%d, engine=%u [idx = %d]\n",
+				  n, err, engine, i);
+			if (err)
+				break;
+
+			if (ed == NOLEAK)
+				engines[i] = engine;
+		}
+
+		if (ed == NOLEAK) {
+			while (--i >= 0) {
+				igt_debug("[%2d] Destroy engine: %u\n", n, engines[i]);
+				xe_engine_destroy(fd, engines[i]);
+			}
+		}

tests/xe/xe_create.c static void create_invalid_size(int fd) · line 185

Quoted 10 lines
tests/xe/xe_create.c +10 -0
+	}
+	igt_waitchildren();
+
+	xe_vm_destroy(fd, vm);
+	close(fd);
+
+	seconds = igt_seconds_elapsed(&tv);
+	igt_assert_f(seconds < MAXTIME,
+		     "Creating %d engines tooks too long: %d [limit: %d]\n",
+		     MAXENGINES, seconds, MAXTIME);

Maybe it would be better to use igt_until_timeout() here ?

Regards,
Kamil

Quoted 21 lines
tests/xe/xe_create.c +8 -0
+}
+
 /**
  * SUBTEST: create-massive-size
  * Description: Verifies xe bo create returns expected error code on massive
@@ -121,6 +218,12 @@ igt_main
 		create_invalid_size(xe);
 	}
 
+	igt_subtest("create-engines-noleak")
+		create_engines(xe, NOLEAK);
+
+	igt_subtest("create-engines-leak")
+		create_engines(xe, LEAK);
+
 	igt_subtest("create-massive-size") {
 		create_massive_size(xe);
 	}
Signature · 1 line
2.34.1
Reviewed-by on v4 1/1
#4 lore raw
In reply to Zbigniew Kempczyński

Hi Zbigniew,

Quoted 4 lines · Zbigniew Kempczyński

Exercise basic engine concurrency create/destroy functionality.

Lgtm,

Quoted 134 lines

---

v2: use different random seeds in children to avoid same engine
pattern selection (Kamil)
check execution time and report failure if it's too long (Kamil)
v3: drop variable (Kamil)

---
 tests/xe/xe_create.c | 103 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
tests/xe/xe_create.c +103 -0
index ae21154646..b427c51fd5 100644
@@ -88,6 +88,103 @@ static void create_invalid_size(int fd)
 	xe_vm_destroy(fd, vm);
 }
 
+enum engine_destroy {
+	NOLEAK,
+	LEAK
+};
+
+static uint32_t __xe_engine_create(int fd, uint32_t vm,
+				   struct drm_xe_engine_class_instance *instance,
+				   uint64_t ext,
+				   uint32_t *enginep)
+{
+	struct drm_xe_engine_create create = {
+		.extensions = ext,
+		.vm_id = vm,
+		.width = 1,
+		.num_placements = 1,
+		.instances = to_user_pointer(instance),
+	};
+	int err = 0;
+
+	if (igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE, &create) == 0) {
+		*enginep = create.engine_id;
+	} else {
+		igt_warn("Can't create engine, errno: %d\n", errno);
+		err = -errno;
+		igt_assume(err);
+	}
+	errno = 0;
+
+	return err;
+}
+
+#define MAXENGINES 2048
+#define MAXTIME 2
+
+/**
+ * SUBTEST: create-engines-%s
+ * Description: Check process ability of multiple engines creation
+ * Run type: FULL
+ *
+ * arg[1]:
+ *
+ * @noleak:				destroy engines in the code
+ * @leak:				destroy engines in close() path
+ */
+static void create_engines(int fd, enum engine_destroy ed)
+{
+	struct timespec tv = { };
+	uint32_t num_engines, engines_per_process, vm;
+	int nproc = sysconf(_SC_NPROCESSORS_ONLN), seconds;
+
+	fd = drm_reopen_driver(fd);
+	num_engines = xe_number_hw_engines(fd);
+	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
+
+	engines_per_process = max_t(uint32_t, 1, MAXENGINES / nproc);
+	igt_debug("nproc: %u, engines per process: %u\n", nproc, engines_per_process);
+
+	igt_nsec_elapsed(&tv);
+
+	igt_fork(n, nproc) {
+		struct drm_xe_engine_class_instance *hwe;
+		uint32_t engine, engines[engines_per_process];
+		int idx, err, i;
+
+		srandom(n);
+
+		for (i = 0; i < engines_per_process; i++) {
+			idx = rand() % num_engines;
+			hwe = xe_hw_engine(fd, idx);
+			err = __xe_engine_create(fd, vm, hwe, 0, &engine);
+			igt_debug("[%2d] Create engine: err=%d, engine=%u [idx = %d]\n",
+				  n, err, engine, i);
+			if (err)
+				break;
+
+			if (ed == NOLEAK)
+				engines[i] = engine;
+		}
+
+		if (ed == NOLEAK) {
+			while (--i >= 0) {
+				igt_debug("[%2d] Destroy engine: %u\n", n, engines[i]);
+				xe_engine_destroy(fd, engines[i]);
+			}
+		}
+	}
+	igt_waitchildren();
+
+	xe_vm_destroy(fd, vm);
+	close(fd);
+
+	seconds = igt_seconds_elapsed(&tv);
+	igt_assert_f(seconds < MAXTIME,
+		     "Creating %d engines tooks too long: %d [limit: %d]\n",
+		     MAXENGINES, seconds, MAXTIME);
+}
+
 /**
  * SUBTEST: create-massive-size
  * Description: Verifies xe bo create returns expected error code on massive
@@ -121,6 +218,12 @@ igt_main
 		create_invalid_size(xe);
 	}
 
+	igt_subtest("create-engines-noleak")
+		create_engines(xe, NOLEAK);
+
+	igt_subtest("create-engines-leak")
+		create_engines(xe, LEAK);
+
 	igt_subtest("create-massive-size") {
 		create_massive_size(xe);
 	}
Signature · 1 line
2.34.1