All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] tests/amdgpu: fix userptr PTE invalidation stress test
@ 2026-08-13  0:46 vitaly.prosyak
  2026-08-13  0:46 ` [PATCH v1 1/1] tests/amdgpu: replace fork-based memory pressure with mmap in userptr " vitaly.prosyak
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: vitaly.prosyak @ 2026-08-13  0:46 UTC (permalink / raw)
  To: igt-dev; +Cc: Vitaly Prosyak

From: Vitaly Prosyak <vitaly.prosyak@amd.com>

The amd_userptr_invalidation stress subtest used fork(2048) to create
memory pressure, which fails in CI containers governed by a cgroup v2
pids controller (EAGAIN on fork), causing false FAIL on all ASICs.

More critically, the test had a logic error: aggressive mmap-based
memory pressure recycled the original 0xAA physical pages before the
GPU read them, masking PTE invalidation failures on unpatched kernels
and turning the test into a false PASS on both good and bad kernels.

This series fixes both problems:

  - Replace fork()-based pressure with pipe fd pressure only (no mmap).
    Pipe pairs consume file descriptors without physical page recycling,
    so the original 0xAA pages remain resident after munmap().

  - Without page recycling, an unpatched kernel that leaves GPU PTEs
    stale after munmap() will have the SDMA engine read the original
    0xAA data through the stale mappings, triggering the FAIL assertion:
      "destination contains N bytes of original data (0xAA)"

  - A patched kernel fires the MMU notifier on munmap(), invalidates the
    GPU PTEs, and the SDMA engine reads from the dummy zero page instead,
    so original_count == 0 and the test passes in ~1 second.

Tested on:
  - GFX1200 (Navi 48, kernel 7.1.0+, patched):   PASS in 0.93s
  - GFX1102 (Navi 33, kernel 6.18.0+, unpatched): FAIL in 13.2s
    (destination contained original 0xAA pattern, indicating GPU PTEs
     were not flushed after munmap())

Vitaly Prosyak (1):
  tests/amdgpu: replace fork-based memory pressure with mmap in userptr
    stress test

 tests/amdgpu/amd_userptr_invalidation.c | 32 +++----------------------
 1 file changed, 3 insertions(+), 29 deletions(-)

-- 
2.54.0


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

end of thread, other threads:[~2026-08-13  7:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13  0:46 [PATCH v1 0/1] tests/amdgpu: fix userptr PTE invalidation stress test vitaly.prosyak
2026-08-13  0:46 ` [PATCH v1 1/1] tests/amdgpu: replace fork-based memory pressure with mmap in userptr " vitaly.prosyak
2026-08-13  1:31   ` Zhang, Jesse(Jie)
2026-08-13  1:40 ` ✓ Xe.CI.BAT: success for tests/amdgpu: fix userptr PTE invalidation " Patchwork
2026-08-13  1:51 ` ✓ i915.CI.BAT: " Patchwork
2026-08-13  6:27 ` ✗ i915.CI.Full: failure " Patchwork
2026-08-13  7:40 ` ✓ Xe.CI.FULL: success " Patchwork

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.