diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-23 08:29:09 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-23 08:29:09 -0400 |
| commit | 6c845235b806b942d6760e7432bc3e318b65609c (patch) | |
| tree | 342a28d488a4a3a474ade812eea29c4b916c1b27 /tools/guest-diag | |
| parent | a42e596308dc05e4b691ce219e27297872f7ccff (diff) | |
| download | open-iov-6c845235b806b942d6760e7432bc3e318b65609c.tar.gz open-iov-6c845235b806b942d6760e7432bc3e318b65609c.zip | |
guest-pin-stream: skip non-readable VMAs in the high-VA scan
A CUDA device buffer is a PROT_NONE reservation (often hundreds of MB).
Its pages are never present in the pagemap, so scanning it yields no
pairs - but it consumed the VMA_MAX_PAGES budget, and the scan never
reached the client's present staging buffers that sit ABOVE the device
reservation. Observed: a client whose device range started below its
staging buffer got no high-VA pins at all; its H2D copies failed rc=-2
forever and the client read back stale data (soak run: 9/9 green then
streams2 bad=32737). Skipping '---' VMAs restores the pins (9 fresh
high-VA injections in the first run; streams2 bad=0).
Diffstat (limited to 'tools/guest-diag')
| -rw-r--r-- | tools/guest-diag/guest_pin_stream.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/guest-diag/guest_pin_stream.py b/tools/guest-diag/guest_pin_stream.py index bb253a2..aa21655 100644 --- a/tools/guest-diag/guest_pin_stream.py +++ b/tools/guest-diag/guest_pin_stream.py @@ -1544,6 +1544,18 @@ def scan_vmas(fd, pid, out): parts = line.split() if len(parts) < 5: continue + # Skip mappings with no read permission: a CUDA device buffer + # is a PROT_NONE reservation (e.g. `---p 00000000 00:00 0`), + # potentially hundreds of MB. Its pages are never present in + # the pagemap, so scanning it produces no pairs - but it + # consumed the VMA_MAX_PAGES budget and the scan never reached + # the client's present staging buffers that sit ABOVE the + # device reservation (observed: a client whose device range + # started below its staging buffer got no pins at all and its + # H2D copies failed with rc=-2 forever). + perms = parts[1] if len(parts) >= 2 else '' + if 'r' not in perms: + continue # Anonymous mappings (no path field) are the client's UVM sysmem # buffers when the driver maps them without a /dev/zero backing: # the second client's cudaMalloc'd data buffers show up exactly |
