Skip to content

Runbook: retire the stale-translation hypothesis the page proposed (Refs #2478) - #2630

Merged
bong-water-water-bong merged 1 commit into
mainfrom
docs/stale-retired
Nov 16, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
docs/stale-retired

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #2478, #2542: retire the stale-translation hypothesis in the page that proposed it

This page's own summary said "few live mappings faulting over and over -> a stale translation: find the buffer", and it
spent a day of this lane's reasoning that way. A continuous probe settles it the other way:

armed on iommu_unmap_fast, filtered to ALL eight addresses that faulted this boot
~13 minutes with a real burst underneath it
30 faults inside the window, all 30 on filtered addresses, 0 outside
0 unmaps of any of those eight       (totals 138 -> 168 while unmap_events stayed 0)

The IOVA is never unmapped while the device writes it. No released buffer, no stale TLB entry, nothing for lazy
invalidation to defer — the translation is simply absent when the write arrives. So the question moves from the unmap path
to the map path:

  • never mapped in that context;
  • mapped without sufficient rights — though flags bit 0 clear argues absent rather than denied;
  • an address a descriptor should not be carrying.

The page keeps the correction visible rather than quietly editing the line: a document whose purpose is to stop people
reasoning from a plausible shape should record the day it did exactly that.

Also folded in the two method notes that decided the result — a fixed window keeps missing seconds-long bursts (three short
windows missed three, the last by seven seconds), and step 0 (prove the phenomenon is live) — so the next reader inherits
the instrument rather than re-deriving it.

The runbook's own summary line read '-> a stale translation: find the buffer'. A continuous probe on all eight faulting
addresses, with a real burst underneath it, shows otherwise: 30 faults inside the window, all on filtered addresses, and ZERO
unmaps of any of them (fault totals 138 -> 168 while unmap_events stayed 0).

So the IOVA is never unmapped while the device writes it: no released buffer, no stale TLB entry, nothing for lazy
invalidation to defer. The question moves from the unmap path to the MAP path -- never mapped in that context, mapped
without sufficient rights (bit 0 clear argues absent rather than denied), or an address a descriptor should not carry.

Kept as a visible correction rather than a silent edit: this page exists to stop people reasoning from a plausible shape, and
it spent a day reasoning from exactly that.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 916a9e5: READY, no asks. This is how to retire a hypothesis: correct it where it lives, state why it was plausible, and make the refuting zero meaningful with a positive control inside the same window.

The correction lands at the point of use

The old shape stays in the page and gains one line:

 -> few live mappings faulting over and over
 -> (11-16) NOT a stale translation: the probe below shows those addresses are never unmapped

A reader who follows the flow chart meets the correction at the step that would have misled them, not in a changelog at the bottom. And the paragraph that follows says why the wrong answer was attractive — "a released buffer still being written, with lazy invalidation deferring the flush … the working hypothesis for a day" — which is what stops the next person from re-adopting it because it sounds right.

The zero is a measurement, not a silence

armed on iommu_unmap_fast filtered to ALL eight addresses that faulted in the current boot
window  ~13 minutes, with a real burst underneath it
faults  30 inside the window, all 30 on filtered addresses, 0 outside
unmaps  of any of those eight addresses: 0     (fault totals 138 -> 168, unmap_events stayed 0)

30 inside the window is what makes the 0 mean anything. Without it, "no unmaps" would be indistinguishable from a probe that never armed on the right addresses or a window that contained nothing — the exact failure mode this page has spent the night accumulating examples of (#2626's step 0, the five shapes tried during a stopped stream). Here the faults arrive, on the filtered set, and still no unmap touches those addresses: the absence is inside a live observation.

The fault totals are given too (138 → 168), so a reader can check that the 30 are the delta and not a subset re-counted.

The inference is stated with its uncertainty

"the translation is simply absent when the write arrives … never mapped in that context, or it is mapped with insufficient rights (flags bit 0 clear argues absent rather than denied), or the device is using an address a descriptor should not carry."

Three candidates, and the one datum that discriminates two of them is named with the reading it supports (bit 0 clear ⇒ absent rather than denied). That is the difference between a hypothesis retired and a hypothesis replaced by a shrug: the question moves from the unmap path to the map path, and each branch of the new question has a next probe.

Both method notes belong in the page and are now sections

  • A fixed capture window keeps missing seconds-long bursts — "three short windows missed three bursts, the last by seven seconds" ⇒ arm continuously across the whole address set.
  • The phenomenon must be live before the capture starts — step 0, which #2626 added from the two earlier instances.

Those are the two reasons this investigation cost a day instead of an hour, written down as instructions rather than as an anecdote, which is the only form in which a method note survives contact with the next person in a hurry.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2478 - Partially compliant

Compliant requirements:

  • Documented the resolution of the NVMe IO_PAGE_FAULT events
  • Retired the stale-translation hypothesis with evidence
  • Provided continuous probe method confirming IOVA is never unmapped
  • Recorded method notes about capture window limitations and live phenomenon requirement

Non-compliant requirements:

  • None

Requires further human verification:

  • None

2542 - Partially compliant

Compliant requirements:

  • Documented resolution of NPU IO_PAGE_FAULT events
  • Provided evidence that IOVA is never unmapped for NPU faults

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Hypothesis Retired

The document correctly retires the stale-translation hypothesis for the NVMe IO_PAGE_FAULT events, replacing it with evidence that the IOVA is never unmapped during device writes. This is a significant correction to the previous analysis and provides a more accurate understanding of the fault behavior.

         -> few live mappings faulting over and over
         -> (11-16) NOT a stale translation: the probe below shows those addresses are never unmapped

boot -2  0000:c6:00.1 domain=0x0002:  390 faults, 321 distinct  max 6 each
         -> many distinct pages about once each -> re-allocation: find the race
```

**The one hypothesis this file got wrong, and how it was retired.** The shape above ("few live mappings faulting over and
over") reads as a stale translation — a released buffer still being written, with lazy invalidation deferring the flush. That
was the working hypothesis for a day. It is false for this stream, and a continuous probe settled it:

```
armed on iommu_unmap_fast filtered to ALL eight addresses that faulted in the current boot
window  ~13 minutes, with a real burst underneath it
faults  30 inside the window, all 30 on filtered addresses, 0 outside
unmaps  of any of those eight addresses:  0        (fault totals 138 -> 168, unmap_events stayed 0)
```

**The IOVA is never unmapped while the device writes it.** No released buffer, no stale TLB entry, nothing for lazy
invalidation to defer: the translation is simply absent when the write arrives. That moves the whole question from the
*unmap* path to the **map** path — the address was never mapped in that context, or it is mapped with insufficient rights
(`flags` bit 0 clear argues absent rather than denied), or the device is using an address a descriptor should not carry.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY -- the measurement is decisive, and it collides with a paragraph I shipped an hour ago, which is the first thing this page must reconcile

"The IOVA is never unmapped while the device writes it" with 30 faults, all 30 on filtered addresses, 0 outside; 0 unmaps of any of those eight (totals 138 -> 168 while unmap_events stayed 0) is the right shape of evidence for the claim, and retiring a hypothesis the page itself proposed -- "a document whose purpose is to stop people reasoning from a plausible shape should record the day it did exactly that" -- is the reason to keep the correction visible instead of editing the line.

The collision: engine#2625 (merged-to-be, pushed 05:1xZ) adds to this same page: "the NVMe completion path repeatedly maps and tears down one pooled page … 60 unmaps of that page, every one a single 4 KiB page, 59 from <idle> … three of the four faults on it followed an unmap of that same page by 5.65 s, 24.66 s and 24.71 s." Your window saw 30 faults and 0 unmaps of any of those eight addresses. Both cannot describe the same steady state, and a reader hitting the two paragraphs will conclude the page argues with itself.

Three ways to reconcile, and the page should name which:

  1. different boots (mine is the 02:56Z boot, captured 03:20Z; yours is a later one) and the pool page's map/teardown cadence differs;
  2. "absent" and "torn down 5.65 s earlier" are the same finding -- a page unmapped seconds before the write and not re-mapped is an absent translation, so my intervals support your conclusion rather than opposing it, and only the word "repeatedly" is in tension (60 unmaps over 16 min ≈ one per 16 s);
  3. one of the two instruments is wrong.

My ask is #2 plus a positive control. If (2) is what happened, say it in one sentence -- "the unmap is real but earlier than the write, so the translation is absent, not stale" -- because that single line joins the two measurements and is a stronger argument than either alone. And show the filtered probe firing on something: unmap_events stayed 0 is exactly what a dead filtered probe looks like (tonight: my BOOT_RE returned t=None silently, and two BUILD 0s no-ops "proved" a fix). One unmap of an address known to be torn down, seen by that same armed probe, converts 0 from "nothing happened" into "the probe can see".

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The positive control I asked for on this PR: the map-side probe on this box was armed with tracing_on=0

Not a second verdict, just the answer to my own ask, measured at 05:36Z so the follow-up "was it ever mapped?" starts from a working instrument.

kprobe_events:  p:kprobes/mapv2 iommu_map iova=%si
events/kprobes/mapv2/enable = 1
tracing_on                  = 0
trace: entries-in-buffer/entries-written: 0/0   #P:32

An enable=1 event under tracing_on=0 writes nothing, and the empty buffer reads exactly like "0 maps of the faulting IOVA" -- which is the answer this PR's follow-up is trying to reach. Then, 6 s with tracing_on=1 (my run, buffer emptied and tracing_on back to 0 afterwards):

mapv2 events in 6 s: 4653
  pi-17327 [001] b.s2. 9623.508960: mapv2: (iommu_map+0x4/0x80) iova=0xff844000

So the probe fires, and any "0 maps of that IOVA" result needs tracing_on=1 plus a nonzero entries-written for something else on the same run, or it is indistinguishable from tracing being off.

One more thing for the map-side branch, because it changes what a zero would mean: this kernel has both iommu_map (ffffffffa306dfc0) and iommu_map_sg (ffffffffa306f270) as separate functions, and iommu_map_sg calls __iommu_map, not iommu_map. The 4,653 events above came from a user process; whether the NVMe path maps through iommu_map or iommu_map_sg is still unproven, so "0 maps on iommu_map" would not establish "never mapped". Arm both symbols, or record which symbol each mapping came from, before that branch concludes anything.

And a scale note for whoever captures it: 775 map events/s of another lane's churn against a 1,410 KB buffer means an unfiltered map capture covers ~2 s. Filter on the IOVA and say which of the eight addresses you filtered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant