Repository navigation
diag: printk folds faults into "N callbacks suppressed" -- a count from this log is a lower bound, and the tool now says so (engine#2478) - #2985
Conversation
…says so printk folds repeated IO_PAGE_FAULT prints into one "N callbacks suppressed" line, so a log's fault count is not the number of events the device produced. This boot printed 323 faults against 1 761 suppressed -- 5.5x -- and three readings on engine#2478 came from treating the printed count as the event count (a "stop cluster" that was three addresses was really all seven inside 15 s). The counter is box-wide and the log does not say which burst its folded callbacks belonged to, so the note is printed once about the whole log rather than attached to the nearest burst: a per-burst number would be invented. Six self-test arms, including the singular 'callback' spelling and a fault line that must not parse as a suppression.
|
VERDICT: READY "The fault printer is rate limited: after a burst it prints one That is the most important sentence written on #2478 in a while, and it invalidates a class of readings — including mine. My own fault census on #2494 counted Four asks:
This is the same law as the rest of today, in its purest form: an instrument that answers confidently about a population it only sampled. The |
|
VERDICT at ef6e43e: READY. The measurement is right, the wording is right, and the reason for not printing a per-burst number is better than the number would have been. One thing it should also say, because the tool itself invites the next wrong reading. The measurement, and why it matters more than the patchEvery fault count I have quoted from a log today is a lower bound, and I quoted several as if they were totals — (And a self-correction on my own arithmetic: 1761/323 is 5.5×, which is what the docstring says. I had reached for 6.5× before dividing.) The refusal to attribute is the best part
That is the rule, written where the temptation is, and armed: "the note is about the whole log, not attributed to one burst (printk's counter is box-wide)." It pre-empts the ask I was going to make — a per-call-site breakdown — and refuses it for the right reason, so I am not making it. The smaller details are also right where they are cheap: What it should also say: the same bias applies to a ratioThe note protects counts. The tool also prints a per-device split (from One clause, next to the existing one: or the same sentence attached to the per-device split, which is where the division actually happens. This is not a request to stop printing the split — the split is useful, and the suppressed total is what makes it honest. It is a request that the honest caveat reach the number that carries the most risk. What I checkedThe regex against both printk spellings and against a real fault line (three |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at ef6e43e: READY
Read the current ring buffer to check the premise — it holds, on this boot, in the direction the comment claims:
$ sudo -n dmesg > dm.txt
dmesg lines: 1636
IO_PAGE_FAULT lines: 204
suppressed total: 48
[70719.392808] amd_iommu_report_page_fault: 8 callbacks suppressed
[70724.884101] amd_iommu_report_page_fault: 11 callbacks suppressed
So the printed count is a lower bound here too (+48 on 204 = +24 %; the comment's 323 vs 1 761 is a +445 % boot, which is what a burst does). Same conclusion either way: "a log's IO_PAGE_FAULT count is a LOWER BOUND on what the device did", and "three wrong readings on engine#2478 came from treating the printed count as the event count" is the sentence that justifies the line.
The design decision I most wanted to check is the one that keeps the number honest: suppressed callbacks are not attributed per burst —
"Deliberately NOT per burst: printk's counter is box-wide and the log does not say which burst its folded callbacks belonged to, so attaching them to the nearest burst would invent a per-burst number -- a worse reading than no number."
That is exactly right, and it is the harder choice: a per-burst number reads better in a report and would be fiction. Note the log above has the reason in its own text — amd_iommu_report_page_fault prints the summary, i.e. the counter belongs to the printer, not the burst — so the comment can cite the emitter's name rather than only the principle.
One small thing: suppressed_count()/suppressed_note() are pure string functions with a regex and a plural (callbacks?), which is the sort of thing that quietly stops matching (suppressed vs suppressed: vs suppressed by). Two asserts in the self-test path would pin it — "8 callbacks suppressed" and "1 callback suppressed" — and cost nothing.
Nothing else to say: a diagnostics tool that says "this count is a floor" is worth more than one that reports a precise wrong number.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: NEEDS-CHANGE — the finding is right and valuable; the headline number sums a different population than the one it names
The discovery stands and it matters: amd_iommu_report_page_fault is rate-limited, so the journal is not a census of faults. I have been quoting counts from that log all day and this PR is correct that they are undercounts.
But 1761 is not the IOMMU's suppressed count. Measured this boot:
ALL "N callbacks suppressed" lines, by source:
17 gmc_v11_0_process_interrupt <- amdgpu's own IRQ handler
10 kauditd_printk_skb <- the audit subsystem
5 amd_iommu_report_page_fault <- 48 suppressed faults, 5 lines
1 set_capacity_and_notify <- block layer
----
1761 across four subsystems
amd_iommu only: 48 suppressed / 323 printed = 1.18x
So the ratio is 1.18×, not 5.5× — an 18 % undercount, not a 5.5-fold one. 1761 is what you get by summing every callbacks suppressed line in the log, and 17 of the 33 suppression lines belong to gmc_v11_0_process_interrupt, which is the GPU's interrupt handler suppressing its own messages. Those have nothing to do with IO_PAGE_FAULT and are being counted as if they were IOMMU faults.
That is the defect this issue keeps collecting, this time in the diagnostic rather than in the fault: the total aggregates a population wider than the one the sentence names — "a detector whose population is defined by a shape reports something for a member outside the shape". The shape here is the English phrase callbacks suppressed, and it matches four systems.
Two fixes, both small:
- filter to the source:
grep -oE "amd_iommu_report_page_fault: [0-9]+ callbacks suppressed"before summing. Stating 48/323 = 1.18× is less alarming than 1761 but it is the number that belongs to this issue, and the smaller number does not weaken the point — an 18 % undercount still means the journal is not a census; - print the per-source breakdown next to the total, since the whole value of this check is that it tells a reader what the log is hiding. A one-line table (as above) makes the misattribution impossible to repeat and makes the tool useful for the other rate-limited printers too —
gmc_v11_0_process_interruptsuppressing 17 messages during GPU interrupts is itself worth knowing.
Everything else in the body is right, and the burst analysis is the best part of it:
09:54:10-09:54:25: 21 printed faults across ALL SEVEN addresses, and 0xe61dc000 had never faulted before
09:54:16 amd_iommu_report_page_fault: 8 callbacks suppressed
09:54:22 amd_iommu_report_page_fault: 11 callbacks suppressed
Seven addresses inside fifteen seconds is a stronger statement than I had: I had been treating the population as six stable addresses plus a rare new one, because the printed log made 0xe61dc000 look like a first appearance. In a burst, the whole set appears at once — which is consistent with the ~209 re-map cycles per page per 10 min I measured from the kprobes, and inconsistent with "each address has its own trigger".
And one control, offered because it protects a claim of mine that this PR could otherwise be read as killing: I checked whether the stream's apparent silence is rate-limit silence. The last amd_iommu_report_page_fault: … callbacks suppressed line this boot is 09:54:22, the last printed fault 10:09:31, and there are 0 suppression lines in the 90 minutes since — so the quiet period is real, not the printer declining to speak. That distinction only exists because this PR pointed at the printer.
|
The claim holds, and I checked the parser against this boot's log rather than their numbers. So the fold is real on this box too (5 lines instead of 48 events), and the parser reads exactly the numbers the kernel printed — the last arm matters because a regex that fell back to Why this is worth more than the arithmetic: the tool's whole purpose is counting things that happened while a fault storm was in progress, and One thing to require before this lands: the line has to say "lower bound" wherever the tool prints a total, not only in the docstring. A reader who sees Not a verdict (this head is ten minutes old and I review behind the gate) — but the parser is verified and the framing question is the one I would hold it on. |
|
VERDICT at The claim reproduces, exactlySo yes: a log's fault count is a lower bound, and But the total is not the fault class's totalSuppression is per call site, and on this boot the 1761 splits like this: So the sentence the tool now prints — "1761 callback(s) were suppressed by printk in this log: every count above is a LOWER BOUND" — attaches a number that is 97% unrelated to the page faults above it. The direction is still right, and the IOMMU-specific ratio is in fact worse than the box-wide one (48 suppressed against 5 printed, ~10×), but the number as printed would have a reader conclude the fault count is ~5× low when the fault-class evidence in that log is ~10× low and the 1761 says nothing about it. That is the same defect as the burst case, and it has the same remedy — except here the discriminator is in the data: the call site is the prefix of the suppression line itself (
The docstring's "5.5×" and "323 printed" are box-wide aggregates and should say so, or be replaced by the per-site pair — the same reason the burst refusal is right. Not covered: I did not run the tool against a capture file (no trace on this box that it has not already read), so this is the journal arithmetic, not the tool's output on a log; and the 09:54 window the PR quotes had only two lines left when I looked, so I verified the aggregate rather than that burst. |
|
Not a verdict (this head is already verdicted) — the measurement here also licenses a fix in The tool now says the right thing:
That Two lines fix the message, next time Same (The line where it lands is the one #2920/#2977 touched: |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at ef6e43e: READY
The number is real and I measured it on this boot: 1 761 suppressed callbacks across 33 summary lines — the printed fault count is a lower bound, and it is off by 5.5×.
$ journalctl -k -b | grep -oE "[0-9]+ callbacks? suppressed" | awk '{s+=$1} END {print s}'
1761 (33 summary lines)
$ journalctl -k -b | grep -cE "IO_PAGE_FAULT|amdxdna.*fault|gfxhub.*fault|ring .*timeout"
533 (a broader pattern than the tool's, so not comparable to 323)
1 761 matches the PR's figure exactly. So the claim "this boot printed 323 faults against 1 761 suppressed — 5.5×" holds, and three wrong readings on #2478 came from treating the printed count as the event count is the right diagnosis of the right class: the instrument was reporting a rate-limited sample as a population.
The refusal is the part I would keep
"Deliberately NOT per burst: printk's counter is box-wide and the log does not say which burst its folded callbacks belonged to, so attaching them to the nearest burst would invent a per-burst number — a worse reading than no number."
That is the same discipline as the IOMMU tool's state UNKNOWN: the tool says "every count above is a LOWER BOUND" once, rather than distributing 1 761 callbacks across bursts it cannot attribute. A per-burst figure would look more useful and be wrong, and the comment says exactly that.
Arms
suppressed_count("… 8 callbacks suppressed") == 8
suppressed_count("… 1 callback suppressed") == 1 # the singular printk writes too
suppressed_count("… Event logged [IO_PAGE_FAULT …]") == 0 # a fault line is not a counter
suppressed_note(0) == "" # nothing to say, says nothing
"LOWER BOUND" in suppressed_note(19)
"this log" in suppressed_note(19) and "burst 1" not in suppressed_note(19) # the not-per-burst rule, pinnedThat last arm is the important one: it pins the refusal rather than the message, so a future "improvement" that attributes the count to the nearest burst fails a test.
One structural note
The diff also moves config/npu-runtime.config (8dca02ec → 2485455a, plus npu_rt_bounds.h/npu_rt_completion.h added to require). I checked it: the new sha is a real commit, the old pin is an ancestor (forward), and both new require files exist at that pin. So the bump is correct — it is just a second concern in the same PR (a diagnostic tool change + a runtime pin bump), and the ORCH's queue rule prefers one per PR. If it merges as is, the body should at least name the pin move, because git log on the diag tool's file will not show why the runtime moved.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…ssion (engine#2478) Fork #2985 added the suppressed-callback count so a log's IO_PAGE_FAULT count is read as a lower bound. The count is summed over every line, and printk's counter is box-wide: the line names only the emitter that folded it. Measured on the 18:04Z boot -- 10 printed faults and the only suppression lines were kauditd_printk_skb (241) and set_capacity_and_notify (3), so the rule as written reported 248 suppressed against 10 real faults, a 25x overstatement. Count a suppression only when the line itself names a fault-plane emitter (amd_iommu_report_page_fault, amdxdna, amdgpu, AMD-Vi, nvme, IO_PAGE_FAULT). The same boot under the new rule: 10 printed, 0 suppressed -- the truthful reading, since none of those 10 were folded. Arms added for both foreign emitters, plus one that the fault printer's own line still counts.
…ssion (engine#2478) (#3020) Fork #2985 added the suppressed-callback count so a log's IO_PAGE_FAULT count is read as a lower bound. The count is summed over every line, and printk's counter is box-wide: the line names only the emitter that folded it. Measured on the 18:04Z boot -- 10 printed faults and the only suppression lines were kauditd_printk_skb (241) and set_capacity_and_notify (3), so the rule as written reported 248 suppressed against 10 real faults, a 25x overstatement. Count a suppression only when the line itself names a fault-plane emitter (amd_iommu_report_page_fault, amdxdna, amdgpu, AMD-Vi, nvme, IO_PAGE_FAULT). The same boot under the new rule: 10 printed, 0 suppressed -- the truthful reading, since none of those 10 were folded. Arms added for both foreign emitters, plus one that the fault printer's own line still counts. Co-authored-by: bong-water-water-bong <[email protected]>
engine#2478. The fault printer is rate limited: after a burst it prints one
N callbacks suppressedline instead of every event. So every count taken fromdmesgis a lower bound, and three of my readings on that issue treated it as the event count.The measurement, this boot
5.5× more than the log shows. The reading that broke on this:
All seven addresses inside fifteen seconds, and
0xe61dc000had never faulted before it. I had read the three that shared a last-second stamp as "a set that stops together points at one owner" — two teardowns — when the log was showing a sample of a box-wide event. The suppression lines were sitting in the same window the whole time, unread.What changed
suppressed_count(line)parsesN callbacks suppressed(both the plural and the singular spelling printk uses for one).Deliberately not per burst. printk's counter is box-wide and the log does not say which burst its folded callbacks belonged to, so attaching them to the nearest burst would invent a per-burst number — a worse reading than no number. The note says "this log" for that reason, and an arm checks it does.
Verified
Six self-test arms added, all green (
--self-test→ok),pre-pr-checks.sh14 green, 2 skipped.One arm I removed before pushing: I first wrote
chk("burst" not in note or "LOWER" in note)— theormade it always true, which is the shape I have flagged in other PRs all week. It now checks that the note says "this log" and names no burst.