All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_create: add create-big-bo-interruptible subtest
@ 2026-10-21 14:22 Matthew Auld
  2026-10-21 18:53 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Auld @ 2026-10-21 14:22 UTC (permalink / raw)
  To: igt-dev; +Cc: Thomas Hellström, Matthew Brost

Add a create-big-bo-interruptible subtest that wraps large BO
creation and CPU mmap verification in igt_fork_signal_helper() /
igt_stop_signal_helper() (500 Hz continuous signal interruption) and
also supports non-VRAM (iGPU) platforms using a 512 MiB system memory BO
(roughly matching bug report).

When a large BO creation overflows the migration batchbuffer
suballocation pool (gt->usm.bb_pool), an interruptible suballocator wait
aborts xe_migrate_clear() with -ERESTARTSYS, synchronously drains all
in-flight migration jobs at err_sync:, and restarts
DRM_IOCTL_XE_GEM_CREATE from scratch, livelocking under periodic signals
such as Xorg's SIGALRM smart-scheduler.

Current working theory for user reported bug. Running this locally, it
does indeed run forever on BMG. Patching the intr wait on kernel side,
fixes it.

Assisted-by: LLM
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9644
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 tests/intel/xe_create.c | 47 +++++++++++++++++++++++++++++++++--------
 1 file changed, 38 insertions(+), 9 deletions(-)

diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index fd1993b21..0a1b54ae4 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -411,8 +411,14 @@ static void create_massive_size(int fd)
  * Test category: functionality test
  * Description: Verifies the creation of substantial BO within VRAM,
  *		constituting all available CPU-visible VRAM.
+ *
+ * SUBTEST: create-big-bo-interruptible
+ * Functionality: bo
+ * Test category: functionality test
+ * Description: Verifies the creation of substantial BO while continuously
+ *		interrupted by signals.
  */
-static void create_big_vram(int fd, int gt)
+static void create_big(int fd, int gt, bool interruptible)
 {
 	uint64_t bo_size, size, visible_avail_size, alignment;
 	uint32_t bo_handle;
@@ -422,14 +428,21 @@ static void create_big_vram(int fd, int gt)
 	alignment = xe_get_default_alignment(fd);
 	vm = xe_vm_create(fd, 0, 0);
 
-	visible_avail_size = xe_visible_available_vram_size(fd, gt);
-	igt_require(visible_avail_size);
-
-	bo_size = params.quantity ? params.quantity * 1024ULL * 1024ULL
-		  : ALIGN_DOWN(visible_avail_size * params.percent / 100, alignment);
+	if (xe_has_vram(fd)) {
+		visible_avail_size = xe_visible_available_vram_size(fd, gt);
+		bo_size = params.quantity ? params.quantity * 1024ULL * 1024ULL
+			  : ALIGN_DOWN(visible_avail_size * params.percent / 100, alignment);
+		igt_info("gt%u bo_size=%"PRIu64" visible_available_vram_size=%"PRIu64"\n",
+			 gt, bo_size, visible_avail_size);
+	} else {
+		bo_size = params.quantity ? params.quantity * 1024ULL * 1024ULL
+			  : SZ_512M;
+		igt_info("system bo_size=%"PRIu64"\n", bo_size);
+	}
 	igt_require(bo_size);
-	igt_info("gt%u bo_size=%"PRIu64" visible_available_vram_size=%"PRIu64"\n",
-		gt, bo_size, visible_avail_size);
+
+	if (interruptible)
+		igt_fork_signal_helper();
 
 	bo_handle = xe_bo_create(fd, vm, bo_size, vram_if_possible(fd, gt),
 				 DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
@@ -444,6 +457,9 @@ static void create_big_vram(int fd, int gt)
 	}
 	igt_assert_eq(0, bo_ptr[0]);
 
+	if (interruptible)
+		igt_stop_signal_helper();
+
 	munmap(bo_ptr, bo_size);
 	gem_close(fd, bo_handle);
 	xe_vm_destroy(fd, vm);
@@ -588,7 +604,20 @@ int igt_main_args("Q:p:", NULL, help_str, opt_handler, NULL)
 
 		xe_for_each_gt(xe, gt)
 			igt_dynamic_f("gt%u", gt)
-				create_big_vram(xe, gt);
+				create_big(xe, gt, false);
+	}
+
+	igt_subtest_with_dynamic("create-big-bo-interruptible") {
+		int gt;
+
+		if (xe_has_vram(xe)) {
+			xe_for_each_gt(xe, gt)
+				igt_dynamic_f("gt%u", gt)
+					create_big(xe, gt, true);
+		} else {
+			igt_dynamic("system")
+				create_big(xe, 0, true);
+		}
 	}
 
 	igt_subtest("create-contexts") {
-- 
2.56.0


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

end of thread, other threads:[~2026-11-03 14:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 14:22 [PATCH i-g-t] tests/intel/xe_create: add create-big-bo-interruptible subtest Matthew Auld
2026-10-21 18:53 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-10-21 19:42 ` ✓ i915.CI.BAT: " Patchwork
2026-10-21 21:39 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-22  0:36 ` ✓ i915.CI.Full: success " Patchwork
2026-11-03 14:07 ` [i-g-t] " Jan Maslak
2026-11-03 14:18   ` Matthew Auld

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.