tests/amdgpu: fix userptr PTE invalidation stress test
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | tests/amdgpu: replace fork-based memory pressure with mmap in userptr stress testtests/ | +3 | 1 reply |
Reviews trailers per patch
The patch has a Reviewed-by or Acked-by.
| Patch | Jesse Zhang |
|---|---|
| 1/1 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/1] tests/amdgpu: fix userptr PTE invalidation stress test
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(-)
Signature · 1 line
2.54.0