summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/guest-diag/guest_pin_stream.py12
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