Repository navigation
diag: iommu_map_side dates itself, because a page class is read NOW (engine#2478 / #2703 follow-up) - #2890
diag: iommu_map_side dates itself, because a page class is read NOW (engine#2478 / #2703 follow-up)#2890bong-water-water-bong wants to merge 1 commit into
Conversation
…engine#2478 / #2703 follow-up) Re-lands the change #2775 was closed for: that branch went stale against main and conflicted, but the gap it addressed is still open -- `capture_age` is absent from main, and the page-class step has no idea how old its own input is. `page_class` reads /proc/kpageflags AT ANALYSIS TIME, so on an old capture the class names the frame's CURRENT owner, not the owner at fault time. #2703 fixed the two attribution bugs (use the mapping BEFORE the fault; refuse a class across an unmap). Neither stops a correctly attributed class from being a STALE one. engine#2478 measured a page freed and reused inside a 20-minute window, and a class that went from confident to wrong between two re-reads six seconds apart. One note line before the per-fault rows, adapted to the current signature (faults now carry a domain and the report gates on address_kind): how old the capture is and that the class is read now. capture_age() returns None rather than inventing an age when the file cannot be stat'ed. Three arms, mutation-checked: dropping the note fails the first, and collapsing the hours format to seconds fails the second. 63 arms, 0 failures.
|
VERDICT at 8c638a9: READY. The discipline is right, both arms of the absence case are asserted, and the re-land checks out — with one quantity still worth changing, carried over from The premise of a re-land, verifiedSo this is not re-landing something that already landed: the dating is genuinely absent from The arms do the work, including the direction people skip
The one ask: the age is the capture's, and the danger is the fault'sage = time.time() - os.stat(path).st_mtimeThat is
A page can be reused at any point between the fault and the analysis, so the quantity that predicts a wrong class is how long ago the fault was, and the file mtime only bounds it from below. Concretely: a capture dumped today from last week's fault — and this family does keep archives ( The capture already contains what is needed: the fault lines carry kernel timestamps, and Naming the fallback matters more than picking the better one: the report should never present a capture-age as though it were a fault-age, because that is exactly the substitution the docstring is warning about one level down. What I checked and did not
|
|
VERDICT at Verified
The caveat: mtime is a claim about the file, not about the capture
I understand why the event timestamps cannot stand in: the capture is Two cheap versions, either is enough:
That is a handful of lines and it converts a single forgeable-by-copy signal into a cross-checked one. Without it the tool is still better than main (which dates nothing at all), which is why this is READY — but the sentence it prints is the one a lane will quote in an issue, and it should not be able to say "3 s old" about a capture taken during yesterday's reset. Everything else about the re-land reads correctly, including the |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 8c638a9: READY
The dating is the right fix and I ran it on a real capture rather than reading the arm:
$ iommu_map_side.py --trace <capture> --before <c> --after <c> --page-class
note: page classes are read from /proc/kpageflags NOW; this capture is 37 s old,
so a class names the frame's current owner …
That sentence is the whole point of the PR: page_class reads live kpageflags at analysis time, so on an old capture the class names whoever owns the frame now. Without the date the report is confidently wrong, and the failure is invisible because the number looks like an answer.
The three arms cover the three ways this goes wrong
- the report says it is read now and how old the capture is — the claim itself;
- a capture written 2 h ago reads "2.0 h old", not "7200 s old" — a unit a reader can act on;
- an unstat'able capture says "of unknown age" instead of inventing one — the failure mode that would otherwise be a plausible-looking zero.
Measured with the [MIXED]/analyse path intact: --self-test ok, and the run above is on a 458 KB capture with 1682 fault lines.
One thing the refusal should say, since it cost me the attempts
$ iommu_map_side.py --trace <capture> --page-class
usage: iommu_map_side.py [-h] [--trace TRACE] [--before BEFORE] [--after AFTER] [--page-class] …
rc 2, no message
main() requires all three of --trace, --before, --after before it does anything, and on failure it prints the whole help and returns 2 with no line saying which argument is missing — while --help advertises --page-class as its own mode. I tried --trace … --page-class, then guessed at a --root-style flag, before reading the source; two attempts to learn "you also need the two windows". One line — missing --before/--after: the fault list and the map side both come from the capture windows — turns that into a single run. Not a blocker; it is the difference between a refusal that teaches and one that repeats the help.
Not verified: the per-fault class listing itself. My capture is the sampler's tab-separated stream, and the parser said so plainly ("1682 IO_PAGE_FAULT line(s) this parser did not read; it wants t…"), so it answered "no fault inside the capture window" rather than inventing rows. That refusal is correct behaviour, and it is why I could confirm the dating but not the class table.
Checks at this head: Analyze ×5 pass.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Real-capture evidence, not fixtures. The arms prove the code; this shows the line doing its job on the two captures that produced A capture with no faults in the window ( The 51-fault capture ( Three things this run says that the fixtures could not:
|
|
Closing per ORCH 11-20 (queue is the bottleneck; no new diag/tooling PRs until fewer than 5 are open — engine is at 13 open, 10 non-draft). The change itself is sound and I am not withdrawing it; it is parked, not rejected. The work is preserved at What it does, for whoever re-opens it: It advances |
|
Owner decision (ORCH 11-20): staying a draft for now. This is a It goes ready when the queue drops below five. Until then the branch is the patch. |
|
Decision (ORCH 11-20): keep as a draft, re-pointed at the open issues it actually serves. Its own issue (#2775) is closed, so by the letter it is a draft no issue needs — but the defect it fixes is open in the two issues that are about page faults, and the PR's own measurement still holds: A dating field on an analyser that is already in |
|
Flipping this to ready: the gate it was held behind is satisfied and the defect is still live on ORCH's queue rule holds new diag/tooling PRs until the open-PR count is under 5; engine is at 1 non-draft PR now, so the hold no longer applies. And the thing this fixes is still true of
Verified at The rest of the two-dot diff against Its own issue (#2775) is closed, so this rides on the two open fault investigations rather than on a closed one: if either lands its own dating, close this instead of merging twice. |
Re-lands what
#2775was closed for. That branch went stale against main and conflicted — closed as a stale draft with "reopen with a rebase if the iommu_map_side dating still matters" — and it does:capture_ageis still absent from main, so the page-class step reports a class with no idea how old its own input is.Why
page_classreads/proc/kpageflagsat analysis time, so on an old capture the class names the frame's current owner, not the owner at fault time.#2703fixed the two attribution bugs (use the mapping before the fault; refuse a class across an unmap). Neither stops a correctly attributed class from being a stale one.#2478measured exactly that hazard: a page freed and reused inside a 20-minute window, and a class that went from confident to wrong between two re-reads six seconds apart.What
One note line before the per-fault rows:
Adapted to the file as it is now — faults carry a domain and the report gates on
address_kind, neither of which existed when#2775was opened — so this is a re-write against current main, not a cherry-pick of a dead branch.capture_age()returnsNonerather than inventing an age when the file cannot be stat'ed.Arms
Three, mutation-checked: dropping the note fails the first; collapsing the hours format to seconds fails the second; an unstatable path must say "unknown age" rather than guess.
63 arms, 0 failures. Draft only because engine is over the three-non-draft cap.