From: Jan Maslak <jan.maslak@intel.com>
To: Matthew Auld <matthew.auld@intel.com>
Cc: igt-dev@lists.freedesktop.org,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Matthew Brost" <matthew.brost@intel.com>
Subject: Re: [i-g-t] tests/intel/xe_create: add create-big-bo-interruptible subtest
Date: Tue, 3 Nov 2026 15:07:13 +0100 [thread overview]
Message-ID: <aunqkZXCF9AsnnH6@ART-DEV-395> (raw)
In-Reply-To: <20261021142240.826942-2-matthew.auld@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2283 bytes --]
On Wed, Oct 21, 2026 at 03:22:41PM +0100, Matthew Auld wrote:
> 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>
> ---
Hi Matthew,
> bo_handle = xe_bo_create(fd, vm, bo_size, vram_if_possible(fd, gt),
> DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
Could we use xe_bo_create_caching() with DRM_XE_GEM_CPU_CACHING_WC
here? The existing VRAM case already defaults to WC.
For system-memory BOs, xe_bo_create() defaults to WB, which skips CCS
clearing on LNL, leading to the test passing without calling
xe_migrate_clear(). WC exposes the stall on LNL on an unfixed kernel.
> + if (interruptible)
> + igt_stop_signal_helper();
If a dynamic case fails before this, the helper stays running and the
next GT aborts at assert(!proc->running). I reproduced this with an
injected failure. Could we move the helper start/stop into setup/teardown
fixtures around a group containing this subtest? Then create_big() no
longer needs the interruptible parameter either.
With WC and fixture cleanup, I compared the results with and without
the kernel fix [1]: three 60 s external timeouts without the fix,
versus three passes with it. I've included a suggested diff.
Thanks,
Jan
[1] https://patchwork.freedesktop.org/patch/764504/
[-- Attachment #2: review-fixes.patch --]
[-- Type: text/x-diff, Size: 2596 bytes --]
diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index 0a1b54ae4d..3c96ac8d90 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -418,7 +418,7 @@ static void create_massive_size(int fd)
* Description: Verifies the creation of substantial BO while continuously
* interrupted by signals.
*/
-static void create_big(int fd, int gt, bool interruptible)
+static void create_big(int fd, int gt)
{
uint64_t bo_size, size, visible_avail_size, alignment;
uint32_t bo_handle;
@@ -430,6 +430,7 @@ static void create_big(int fd, int gt, bool interruptible)
if (xe_has_vram(fd)) {
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);
igt_info("gt%u bo_size=%"PRIu64" visible_available_vram_size=%"PRIu64"\n",
@@ -441,11 +442,9 @@ static void create_big(int fd, int gt, bool interruptible)
}
igt_require(bo_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);
+ bo_handle = xe_bo_create_caching(fd, vm, bo_size, vram_if_possible(fd, gt),
+ DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
+ DRM_XE_GEM_CPU_CACHING_WC);
bo_ptr = xe_bo_map(fd, bo_handle, bo_size);
size = bo_size - 1;
@@ -457,9 +456,6 @@ static void create_big(int fd, int gt, bool interruptible)
}
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);
@@ -604,20 +600,28 @@ 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(xe, gt, false);
+ create_big(xe, gt);
}
- igt_subtest_with_dynamic("create-big-bo-interruptible") {
- int gt;
+ igt_subtest_group() {
+ igt_fixture()
+ igt_fork_signal_helper();
- 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_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);
+ } else {
+ igt_dynamic("system")
+ create_big(xe, 0);
+ }
}
+
+ igt_fixture()
+ igt_stop_signal_helper();
}
igt_subtest("create-contexts") {
next prev parent reply other threads:[~2026-11-03 14:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Jan Maslak [this message]
2026-11-03 14:18 ` [i-g-t] " Matthew Auld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aunqkZXCF9AsnnH6@ART-DEV-395 \
--to=jan.maslak@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox