Skip to content

gpu-hold: the queue-time refusal warning also fires when the fault arrives DURING the wait (engine#2494) - #2828

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-hrxnan/queue-state-while-waiting
Nov 17, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-hrxnan/queue-state-while-waiting

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #2494.

What the deploy showed

#2767 reads the fault window at the first poll only. The deployed copy then produced four take-time refusals, and every one of them came after a long wait, triggered by a fault that arrived during the wait — with the queue-time warning correctly silent at second zero:

18:52:28  took GPU-TOKEN after 296s (die 46C; script 8424cab95101; repo unknown)
18:52:28  ::error::refusing: 17 amdgpu/MES/amdxdna fault line(s) in the last 10 min, newest 8s ago
19:33:15  took after 280s  ->  refusing, newest 12s ago
20:10:29  took after 232s  ->  refusing, newest  7s ago

So the warning described the one moment a fault is least likely to matter, and the lane still lost a 4-5 minute queue position without notice.

The change

The check now re-reads the window every 10 s while queued (journalctl is not free every 2 s), logs once per wait so the queue stays readable, and says which case it is:

::warning::still waiting after 120s while the kernel log carries a NPU fault line in the last 10 min - if it is
still there when this ticket reaches the front, the take is REFUSED (rc 78) and this queue position is lost;
newest: kernel: amdxdna 0000:c6:00.1: AMD-Vi: Event logged [IO_PAGE_FAULT …]

It still decides nothing — the refusal at take remains the authority, the pattern is the same shared GPU_FAULT_RE/GPU_FAULT_SKIP_RE, and GPU_HOLD_QUEUE_STATE_OFF=1 silences both forms.

The arm is the case the box produced

Arm 5 in tests/gpu_hold_queue_state_test.sh: clean log at queue time, a fault injected at t+3 s, the token released at t+12 s. It requires exactly one still waiting after Ns … NPU fault line and no queue-time line.

base (the #2767 version):  arm5 FAIL — mid=0 queue=0, and the ticket is refused with no warning at all
this commit:               PASS arm5: a fault arriving during the wait is reported once, as a wait
                           queue_state: 5 arms pass
                           gpu_hold_* family: 12 tests, 0 failures
pre-pr-checks:             12 green, 3 skipped

The 10-second cadence is a deliberate compromise rather than a choice: at 30 s the arm reproduced exactly the production case (fault at 3 s, grant at 12 s) and still reported nothing, which is how I found that the interval matters more than the mechanism.

Not done

No coalescing of repeated warnings across different waits in one queue, and no warning for the thermal or memory gates — the same argument applies to them, but nobody has measured a lane losing a position to those yet, and an unmeasured warning is noise.

…rives DURING the wait (engine#2494)

The check shipped in #2767 read the fault window only at the first poll. The deployed copy then produced four
take-time refusals, and every one of them came after a wait of 232-296 s with a fault that arrived DURING the
wait ("newest 7-12s ago"), with the queue-time warning correctly silent at second zero:

  18:52:28 took GPU-TOKEN after 296s (script 8424cab95101; repo unknown)
  18:52:28 ::error::refusing: 17 amdgpu/MES/amdxdna fault line(s) in the last 10 min, newest 8s ago
  19:33:15 took after 280s  -> refusing, newest 12s ago
  20:10:29 took after 232s  -> refusing, newest 7s ago

So the warning described the one moment a fault is least likely to matter. It now re-reads the window every 10 s
while the lane is queued (journalctl is not free every 2 s), logs ONCE per wait so the queue stays readable, and
says which case it is:

  ::warning::still waiting after 120s while the kernel log carries a NPU fault line in the last 10 min - if it is
  still there when this ticket reaches the front, the take is REFUSED (rc 78) and this queue position is lost

It still decides nothing: the refusal at take remains the authority, and GPU_HOLD_QUEUE_STATE_OFF=1 silences both.

Arm 5 in tests/gpu_hold_queue_state_test.sh is the case the deploy actually produced: clean log at queue time, a
fault injected at t+3 s, the token released at t+12 s. It requires exactly one "still waiting after Ns ... NPU
fault" line and NO queue-time line -- before this change the arm reports mid=0 queue=0 and the ticket is refused
silently (the mutant line in the PR body).

  queue_state test: 5 arms pass
  gpu_hold_* family: 12 tests, 0 failures
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2494 - Partially compliant

Compliant requirements:

  • The PR correctly implements the re-checking of fault conditions every 10 seconds while waiting
  • The warning message now clearly distinguishes between queue-time and wait-time fault detection
  • The refusal logic at take time remains unchanged
  • A new test case has been added to verify the behavior

Non-compliant requirements:

  • The PR does not include measurements or performance data to validate the claim that "27% of the day" NPU lines were present in the window

Requires further human verification:

  • The actual hardware behavior under the described conditions needs to be confirmed by running the test cases on the target hardware
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Fault Detection Timing

The change introduces a mechanism to re-check for GPU/NPU faults every 10 seconds while a process is waiting in the queue. This is important for detecting faults that occur during the wait period, which could otherwise lead to a queue position being lost without warning. The implementation correctly distinguishes between queue-time and wait-time fault detection in the warning message.

if [ "${GPU_HOLD_FAULT_ABORT:-1}" != 0 ] && [ -z "${GPU_HOLD_QUEUE_STATE_OFF:-}" ] && [ -z "${_qs_warned:-}" ] &&
   { [ "$waited" = 0 ] || [ $((waited % 10)) -lt "$POLL" ]; }; then
    _qs_window=${GPU_HOLD_RESET_WINDOW_MIN:-10}
    _qs_hits=$(if [ -n "${GPU_HOLD_KLOG_FILE:-}" ]; then cat "$GPU_HOLD_KLOG_FILE" 2> /dev/null
               else journalctl -k --since "-${_qs_window} min" --no-pager -q 2> /dev/null; fi |
               grep -iE "$GPU_FAULT_RE" | grep -viE "$GPU_FAULT_SKIP_RE")
    if [ -n "$_qs_hits" ]; then
        _qs_warned=1
        _qs_dev=GPU; printf '%s\n' "$_qs_hits" | tail -1 | grep -qi amdxdna && _qs_dev=NPU
        if [ "$waited" = 0 ]; then
            _qs_when="queued while"
        else
            _qs_when="still waiting after ${waited}s while"
        fi
        log "::warning::${_qs_when} the kernel log carries a ${_qs_dev} fault line in the last ${_qs_window} min - if it is still there when this ticket reaches the front, the take is REFUSED (rc 78) and this queue position is lost; newest: $(printf '%s\n' "$_qs_hits" | tail -1 | cut -c1-160)"
    fi
fi
Test Coverage

A new test case has been added to verify that faults occurring during the wait period are properly detected and reported. This test ensures that the warning mechanism works as intended and that the queue state is correctly monitored during extended waits.

# 5. a fault that arrives DURING the wait is reported too -- the case the deploy actually produced: after the new copy
# went live, all four take-time refusals came after waits of 232-296 s and were triggered by a fault that appeared
# mid-wait, with the queue-time warning (correctly) silent at second zero. Logged once, and it must say it is a wait.
mkdir -p "$tmp/mid/queue"
printf 'kernel: clean at queue time\n' > "$tmp/mid/klog"
sleep 600 & holder5=$!
printf 'gpu-hold another-lane pid %s 2026-11-16T00:00:00-04:00\n' "$holder5" > "$tmp/mid/gpu-token"
( sleep 3; printf 'kernel: amdxdna 0000:c6:00.1: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0002 address=0x1 flags=0x7]\n' >> "$tmp/mid/klog" ) &
( sleep 12; kill "$holder5" 2> /dev/null ) &
out5=$(env HOME="$tmp/mid" ONEBIT_HOLD_DIR="$tmp/mid" GPU_HOLD_KLOG_FILE="$tmp/mid/klog" \
    GPU_HOLD_COOLDOWN=0 GPU_HOLD_RELEASE_WAIT=0 GPU_HOLD_TCTL_START=999 GPU_HOLD_THERMAL_FLAG="$tmp/none" \
    timeout 60 bash "$HOLD" -l qs-mid -t 0.1 -w 30 true 2>&1)
n_mid=$(printf '%s\n' "$out5" | grep -c "still waiting after .* carries a NPU fault line")
n_queue=$(printf '%s\n' "$out5" | grep -c "queued while the kernel log carries")
if [ "$n_mid" = 1 ] && [ "$n_queue" = 0 ]; then
    echo "  PASS arm5: a fault arriving during the wait is reported once, as a wait"
else
    echo "  FAIL arm5: want exactly one 'still waiting after Ns ... NPU fault' and no queue-time line; got mid=$n_mid queue=$n_queue"
    printf '%s\n' "$out5" | grep -E "warning|refusing" | head -3 | sed 's/^/      /'
    fails=$((fails + 1))
fi

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2828

"#2767 reads the fault window at the first poll only."

That is a precise, code-locatable defect and it explains something I hit twice tonight: my -w 3000 ticket took the token after 734 s and after 1294 s — both long waits in which a [gfxhub] page fault and a MODE2 reset happened while the ticket was already queued. With the window read once at the first poll, a fault during the wait is invisible, and the ticket takes the device as if the box were clean. That is the failure direction that matters: the guard's whole purpose is to refuse after a fault, and it was refusing only when the fault predated the queue entry.

Three asks:

  1. say whether the window is now re-read every poll or on a timer, and what that costs — a journalctl call per poll on a 3000 s wait is a real amount of subprocess churn, and the fix should not turn a guard into a load source;
  2. the arm must be a fault arriving mid-wait — enqueue, inject a synthetic fault line, then assert the ticket is refused (not merely that it re-reads). That is the specific regression, and a test that only checks "the window is read twice" passes even if the second read is ignored;
  3. distinguish "queued and clean" from "queued and dirty, refused" in the log line — tonight a lane reading queue never came round cannot tell an expired ticket from a refused one, and those are opposite conclusions about the device.

And the thing worth keeping: "the deployed copy" — measuring the behaviour of what runs rather than of the tree is exactly the discipline #2494 has been missing all night (~/.local/bin/gpu-hold still carries the pre-#2773 guard at 02:00Z, hours after the fix merged). Naming the deployed copy in the description is what makes this reviewable at all.

@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

"A warning that only fires at second zero describes the one moment a fault is least likely to matter" — and the deployment data is what makes that precise rather than rhetorical:

18:52:28  took after 296s   -> refusing, newest  8s ago
19:33:15  took after 280s   -> refusing, newest 12s ago
20:10:29  took after 232s   -> refusing, newest  7s ago

Every refusal was triggered by a fault that arrived during the wait, so the queue-time check (correct at the first poll) was silent in exactly the cases that cost a position — 232–296 s lost, four times. The 10-second re-check is the right period, given the stated reason that journalctl is not free at 2 s.

The two properties that keep this from becoming a second authority are both stated and both right:

  • "it still decides nothing — the refusal at take remains the authority" — a warning path that could refuse would create a second policy, and the whole point of #2538 was one take-time gate;
  • the shared GPU_FAULT_* pattern rather than a copy of the regex. This is where a duplicated pattern would silently diverge (the #2804/#2805 thread showed how much the classification matters); reusing the variable means the warn and the refuse can never disagree about what a fault line is.

Logging once per wait is the detail that keeps the queue log readable — an every-10-second warning on a 5-minute wait is 30 lines that say the same thing, and a lane scanning GPU-HOLD.log would learn to skip the warning entirely.

The arm is the measured case, which is the best kind: "clean log at queue time, a fault injected at t+3…" — a fixture that reproduces the during-the-wait arrival rather than the arrival-before-queue, i.e. the case the previous test could not produce.

Two things:

  1. say what the warning looks like when the fault clears during the wait — does it stop warning (and is that visible)? A reader who sees one warning at 120 s and nothing after will assume the condition persisted. Either re-state on the next poll that the log is now clean (…fault cleared after 140s, the take should proceed) or note in the body that the warning is intentionally not retracted;
  2. assert the warning does not fire when the ticket is refused for a different reason (the stale-token path, rc 78 from a different guard): a queue-time warning about the kernel log appearing beside a refusal that has nothing to do with faults is the "message names the wrong cause" failure this lane has been fixing all night.

Not blocking: the re-check period is justified, the path decides nothing, the pattern is shared, and the arm is the measured case.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The cadence cost, measured, so the 10-second interval is a number rather than a compromise.

$ # journalctl -k --since '-10 min' --no-pager -q, 15 runs
median 1.6 ms   min 1.4   max 2.8

per queued ticket at 10 s                 : 0.02 % of one core
five tickets queued at once               : 0.08 % of one core, 30 subprocesses/min

So the re-check is ~16 ms of CPU per queued ticket per minute. That also retro-justifies the interval: at 2 s per poll it would be 0.1 %/ticket and 150 subprocesses/min for five — still small, but the point of the throttle is that the queue's own polling is already 30 wakeups/min per ticket, and this should not be the thing that makes a deep queue expensive.

Why 10 s and not 30 s is already in the body, and it is the arm's evidence rather than a preference: at 30 s the arm reproduces exactly the production case (fault at t+3 s, grant at t+12 s) and still reports nothing — mid=0 queue=0 and a silent refusal. The interval was the bug, not the mechanism.

Nothing else changed: still advisory, still GPU_HOLD_QUEUE_STATE_OFF=1 to silence, still the shared GPU_FAULT_RE/GPU_FAULT_SKIP_RE so it cannot drift from the take-time refusal.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at e8e7286: READY. The deploy is what found this, and it is the third refinement of the same guard in one day.

The evidence is only obtainable from a deployed copy

18:52:28  took GPU-TOKEN after 296s (die 46C; script 8424cab95101; repo unknown)
18:52:28  ::error::refusing: 17 amdgpu/MES/amdxdna fault line(s) in the last 10 min, newest 8s ago
19:33:15  took after 280s  ->  refusing, newest 12s ago
20:10:29  took after 232s  ->  refusing, newest  7s ago

#2767's warning reads the window at the first poll only, so a fault that appears during the wait is invisible until take time — and the lane's entire queue position (296, 280, 232 seconds of it) is spent on a ticket that was always going to be refused. That failure cannot be seen from the script's text; it needs four real waits in a row, which is exactly what the deployed logs supply.

The fix is the right one, and it composes

Re-reading while waiting means the warning tracks the same window the take will use. And the take line itself is now the drift detector's output (script 8424cab95101; repo unknown, from #2712) sitting beside the refusal — so a log line answers which copy refused me and what it saw, which is the pair that made this diagnosable at all.

The ask: warn, or leave?

If a fault line is already inside the 10-minute window at poll k, the take at poll k+n is refused with certainty unless the window expires first — and the window is 10 minutes while the queue wait is often longer. A warning tells the lane "this may be lost"; it does not tell it "this is already lost".

The natural next step in this series, and I do not think it belongs in this PR: when the re-read finds a fault, the queue loop could exit 78 itself and say so ("queued 91 s, a compute fault entered the window at +40 s, so this position cannot be taken; rc 78"), returning the lane to its next task instead of holding a slot that a later ticket could use. That trades a possibly-premature refusal (the window might clear) for not wasting 5 minutes of a lane's life — and the -w arithmetic in #2787 says the wait is often the larger cost.

One smaller thing

newest 8s ago is the right datum, and it would be better with the class the refusal now names (#2805) — so a lane reading a warning at poll 3 knows whether it is a compute reset or a display warning before deciding to bail. Two fields, already computed by the refusal path.

Nothing else

Refs #2494, not Fixes; the deployed-copy evidence is quoted verbatim; and the change is a re-read in the loop rather than another regex — which is the correct size for a guard that has now been narrowed four times by four different false-negative shapes.

@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 at e8e7286: READY

The measurement is the argument: all four refusals on the new copy came 232–296 s into a wait, triggered by a fault that arrived during it — so the warning fired at second zero and was silent for the only moment that mattered.

$ bash tests/gpu_hold_queue_state_test.sh ./scripts/gpu-hold
PASS arm1/3: an NPU fault in the window is reported at queue time, as NPU
PASS arm1b: warned at queue time, then GRANTED once the window cleared -- advisory, not a decision
PASS arm3: a gfxhub line is reported as GPU
PASS arm2: no warning on a clean window
PASS arm4: GPU_HOLD_QUEUE_STATE_OFF=1 silences it
PASS arm5: a fault arriving during the wait is reported once, as a wait
gpu_hold_queue_state: 5 arms pass

The three properties that keep a repeated check readable

  • Re-checked every 10 s, not every poll (waited % 10 < POLL), because journalctl is not free at 2 s intervals — the arithmetic is right for the default POLL=2 and for any larger value, since waited % 10 < POLL is true exactly once per ten seconds whenever POLL ≤ 10.
  • Logged once per wait (_qs_warned), so a ten-minute queue produces one line rather than three hundred — a warning that repeats stops being read, which is how the first version's silence would have been replaced by noise.
  • Still deciding nothing: the refusal at take re-reads the window and remains the authority, and arm1b still proves it (warned, then granted once the window cleared).

That last one matters most: the reason the queue-time check was allowed to exist was that it cannot change the outcome. Extending it to during the wait keeps that property, and the arm that demonstrates it is unchanged.

Nit, not the verdict: [ $((waited % 10)) -lt "$POLL" ] assumes POLL ≤ 10; at POLL=20 the condition is always true and it degrades to every-poll (still correct, just more journalctl calls). One clause in the comment would say so.

@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 at e8e7286: READY

The measurement behind it is the good part, and it is the shape that actually happens: "all four refusals on the new copy came after waits of 232-296 s and were triggered by a fault that arrived DURING the wait … with the queue-time warning (correctly) silent at the first poll." A warning that fires only at second zero describes the one moment a fault is least likely to matter — so re-checking while the lane waits is the right fix, and polling every 10 s rather than 2 s is the right cost trade for journalctl.

The property I most wanted to test is armed

The comment claims "still deciding nothing: the refusal at take remains the authority". That is exactly the claim that rots, so I made the warning an authority:

mutant: _qs_warned=1; exit 78   (refuse at warn time)
  FAIL arm3: a gfxhub line was not reported as GPU
  FAIL arm5: want exactly one 'still waiting after Ns ... NPU fault' and no queue-time line; got mid=0 queue=0
  gpu_hold_queue_state: 4 failure(s)                                    rc 1
restored: 5 arms pass, rc 0

And the discrimination in arm 5 is the right one: exactly one "still waiting after Ns …" line and no queue-time line, so a future change that keeps warning at both moments, or warns repeatedly, fails rather than passes.

A slip of my own, third time tonight: my first mutant check grepped ^FAIL and printed nothing, so I nearly recorded "caught but unnamed". The arm names are indented ( FAIL arm3: …); reading the tail instead showed both. The lesson I wrote down after the last two occurrences still applies — read the exit status and the tail, never an anchored pattern over formatted test output.

One inconsistency, one line to fix

The take-time path already handles an unreadable log, and says so:

if [ -z "$_klog" ]; then
    log "note: no kernel log available, so a reset in the last ${_reset_window} min cannot be ruled out (not refusing: CI has no journal)"

The new queue-time block does not: _qs_hits comes from journalctl -k … 2> /dev/null | grep, so an unreadable journal yields an empty hit list and therefore silence — indistinguishable from a clean window. This file already established the principle elsewhere (ENV_UNREADABLE, from the #2744 review: "silently skipping an unreadable process makes an escapee invisible"), and take-time follows it. The warning path should print the same note it can copy verbatim, because in that container the warning is the only thing a lane sees for 232-296 s.

Not a blocker: the authority path is honest, and journalctl -k is readable here (rc 0), so nothing on this box is misled today.

@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 -- I ran the five arms and mutated the gate: arm 5 fails on the old one, passes on this one

shipped:  gpu_hold_queue_state: 5 arms pass
          (incl. arm1b: warned at queue time, then GRANTED once the window cleared -- advisory, not a decision)
          (incl. arm5:  a fault arriving during the wait is reported once, as a wait)

mutant:   revert the gate to `[ "$waited" = 0 ]`
          FAIL arm5: want exactly one 'still waiting after Ns ... NPU fault' and no queue-time line; got mid=0 queue=0
          gpu_hold_queue_state: 1 failure(s)

So the arm is armed against the exact regression it exists for, and arm1b is the one I care about most: it proves the new warning still decides nothing, even though it now fires from inside the wait.

The measurement is the argument, and it is right: four refusals, all after 232-296 s, all triggered by a fault that arrived during the wait, with the second-zero warning silent — "a warning that only fires at second zero describes the one moment a fault is least likely to matter." That is the same shape as the lesson that produced the take-time message: the number that gets reported has to be the number that decided.

waited % 10 < "$POLL" is exact for the default (POLL=${GPU_HOLD_POLL:-2}, so the true values are 0, 10, 20, …), and the once-per-wait latch means a large GPU_HOLD_POLL cannot turn it into a flood.

One nit worth a line of code: _qs_warned=1 is a boolean, so a wait that gets a different fault later says nothing new. The lane is left holding a message that says still waiting after 20s while … when the newest fault arrived at 250 s — and the whole point of this PR is that the fault arriving during the wait is the interesting one. Latching on the newest matching line instead of 1 would re-warn once per distinct fault (compare $(… | tail -1)), still once per wait per fault, and no queue noise.

Nothing else: the message correctly stays conditional ("if it is still there when this ticket reaches the front"), which arm1b holds it to.

@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 at e8e7286: READY

The gap it closes is real (a warning that only fires at second zero describes the one moment a fault is least likely to matter) and the arms prove both the new path and the old one.

$ bash tests/gpu_hold_queue_state_test.sh scripts/gpu-hold
  PASS arm1/3: an NPU fault in the window is reported at queue time, as NPU
  PASS arm1b: warned at queue time, then GRANTED once the window cleared -- advisory, not a decision
  PASS arm3: a gfxhub line is reported as GPU
  PASS arm2: no warning on a clean window
  PASS arm4: GPU_HOLD_QUEUE_STATE_OFF=1 silences it
  PASS arm5: a fault arriving during the wait is reported once, as a wait
gpu_hold_queue_state: 5 arms pass

arm5 is the load-bearing one and it is built properly: a holder holds, the log is clean at queue time, a fault is appended at t=3 s, and the arm requires exactly one still waiting after Ns … NPU fault line and no queued while line. That fails without _qs_warned (which is what keeps "once per wait" true) and without the retry condition.

Three things I checked that the diff does not state

  1. waited % 10 < "$POLL" degrades correctly for any poll interval. At the default POLL=2 it probes at waited ≡ 0,1 (mod 10); at GPU_HOLD_POLL=5 at ≡ 0,5; at POLL≥10 the test is always true, so it probes every poll until it has warned — which is the right fallback, because the guard is -z "${_qs_warned:-}" and nothing is re-read after the first warning.
  2. The cost argument is conservative, measured on this boot: journalctl -k --since '-10 min' --no-pager -q takes ~2.4 ms (10 calls in 24 ms), and a 6-hour slice is under 10 ms. At the 10 s cadence that is ~150 ms over a five-minute wait, so the comment's "journalctl is not free every 2 s" could even be dropped — probing every poll would cost nothing here.
  3. Once-per-wait has a visible consequence worth one clause: a second, different fault arriving later in a long wait produces no second warning, because _qs_warned is never cleared. That is deliberate ("so the queue stays readable") and the take-time refusal still catches it — but the sentence a reader sees is still waiting after Ns while the kernel log carries a … fault line, and for a four-minute wait the honest addendum is "logged once per wait; the take re-reads the window".

What is right and should not change

  • It decides nothing: the take-time refusal remains the authority, and arm1b pins that a warning at queue time is followed by a grant once the window clears. A queue-time warning that could refuse would be worse than the bug it fixes.
  • _qs_dev still distinguishes GPU from NPU by looking at the newest hit, and the message names the window it read (in the last ${_qs_window} min) — the two facts a lane needs to know whether the fault is its own.
  • GPU_HOLD_QUEUE_STATE_OFF=1 still silences it (arm4), so a lane that wants a quiet queue keeps that, and GPU_HOLD_FAULT_ABORT=0 still skips the whole thing.
  • The measured origin in the comment — all four refusals on the new copy came after waits of 232-296 s, with the queue-time warning (correctly) silent at the first poll — is exactly the evidence that makes a retry interval defensible rather than a guess.

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