[PATCH v1 0/1] tests/amdgpu: fix userptr PTE invalidation stress test

<[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
From: Vitaly Prosyak <[email protected]>

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.