diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 17:27:48 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 17:27:48 -0400 |
| commit | fcb74dfd32442af859ac45979138b40279f96553 (patch) | |
| tree | 4a761e08eded02f680e5c0ece2e9bf634515f08c /tools/guest-diag/semfix_uvmt.py | |
| parent | c903aac3e45a1634764389cd57b7d195b5c895b4 (diff) | |
| download | open-iov-fcb74dfd32442af859ac45979138b40279f96553.tar.gz open-iov-fcb74dfd32442af859ac45979138b40279f96553.zip | |
guest-diag: stream uvbp pushbuffer kptrs for immediate pinning
The first CE channel's push-buffer was only pinned ~1 minute after the
client's failure: uvbp fired at t+4s but semfix's trace read (guest agent,
every 5 loops) picked it up at t+70s, so the tracker wait for value 3 spun
for 16 s. The guest scanner now emits '#pb 0x<kptr>' from the uvbp trace
lines as soon as they appear; the host mirrors them into the sem stream and
semfix resolves/pins the push-buffer through the UVM chain on the next loop
(sub-second).
Diffstat (limited to 'tools/guest-diag/semfix_uvmt.py')
| -rwxr-xr-x | tools/guest-diag/semfix_uvmt.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/guest-diag/semfix_uvmt.py b/tools/guest-diag/semfix_uvmt.py index fd58299..09cc5f8 100755 --- a/tools/guest-diag/semfix_uvmt.py +++ b/tools/guest-diag/semfix_uvmt.py @@ -63,6 +63,8 @@ class Stream: self.off = 0 self.sems = [] self.pids = [] + self.pbs = [] + self.new_pbs = [] def poll(self): try: @@ -77,6 +79,7 @@ class Stream: except OSError: return [], [] new_sems, new_pids = [], [] + self.new_pbs = [] for line in data.splitlines(): if line.startswith("#sem"): m = re.search(r"0x([0-9a-fA-F]+)", line) @@ -85,6 +88,13 @@ class Stream: if v not in self.sems: self.sems.append(v) new_sems.append(v) + elif line.startswith("#pb"): + m = re.search(r"0x([0-9a-fA-F]+)", line) + if m: + v = int(m.group(1), 16) + if v not in self.pbs: + self.pbs.append(v) + self.new_pbs.append(v) elif line.startswith("#pid"): m = re.search(r"(\d+)", line) if m: @@ -265,6 +275,9 @@ def main(): for p in new_pids: log("stream: client pid %d" % p) last_pid = p + for pb in getattr(stream, "new_pbs", []): + log("stream: new pushbuffer 0x%x" % pb) + pbs.add(pb) sems.update(stream.sems) # The guest-agent trace read is slow under client load; use it only |
