Repository navigation
drm/asahi: g17: count busy time across power gates, in timestamp order (#1611 follow-up) - #1879
Open
m0d16l14n1 wants to merge 2 commits into
Open
m0d16l14n1 wants to merge 2 commits into
m0d16l14n1 wants to merge 2 commits into
Conversation
pstate and achieved_frequency_hz printed "unsupported" whenever pstate_status wasn't valid. On a firmware that reports its state (M5, A18 Pro), the state is "stale" after the cores power up, until the firmware's next state report, and the file then read as a missing feature. Print the status word instead. achieved_frequency_hz keeps "unsupported" for a valid state with no frequency in the board's table. busy_ns also gets a "stale" reading, for a total that stopped (used by the next change); every other non-valid busy status still reads "unsupported". Where pstate is unsupported (25G83, and always there through g17::stats::qualify), the status word is "unsupported", so that output is byte for byte the same. The integration test's formatter cases follow the new readings and check "busy_ns stale". Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <nekreshen@yandex.ru>
On a J815 (M5) under a frame-paced load (es2gears + vkcube, 20 s), the cores power-gate about 95 times a second (power_epoch 10861), usually with one utilisation record per power epoch. busy_ns stayed 0 although the 0x13 records kept arriving: - busy time needed two records in one epoch, because every boundary cleared the window start (busy_ts); - the records queued before a boundary, and those drained while the cores read gated, never reached the decoder. Busy time now has its own ordering, separate from the utilisation epoch, on every firmware whose Protocol integrates it (M5 and A18 Pro): - The decoder keeps the firmware timestamp up to which it has credited busy time (busy_mark). Epoch boundaries keep it. A record at or before it adds nothing, so an older queued record, a repeat, or the other role's record for the same time is never credited twice, whatever the drain order. - A later record closes the window since the mark when that is at most two utilisation periods, as before. After a longer gap it closes only its own period (8 ms on M5, 16 ms on the A18 Pro), which lies after the mark: the gap is never credited. Before, such a record only set the baseline. The first record after a gate now credits its period at its own device utilisation. - Records a power boundary keeps out of the averaging epoch (cut off, or drained while gated) are decoded for busy time only (record_busy). The utilisation average, its delivery cadence and the performance state do not see them. Suspend, a real invalidation's discard and quarantine still keep everything out. - A record more than 60 s behind the mark cannot still be queued; it means the firmware clock started again and only sets a new mark. - busy_ns reads stale once a statistics ring is quarantined, since nothing adds to it any more. Credited windows never overlap and each lies at or before its own record's timestamp, so busy_ns stays bounded by elapsed time. 25G83 integrates no busy time and is unchanged. The gated performance state (off, valid 0) is left as it is. Host tests: tools/asahi/run-host-tests.py --only telemetry passes: the decoder's 13 cases, the integration fixture and every listed mutation. New decoder cases: gates between every record, records kept out of the epoch, interleaved roles, clock restart. The A18 Pro window case now expects a record after a gap longer than two periods to credit its own 16 ms period. New ring case: records cut off at a gate and drained while gated count, a repeat from the other role does not, suspend keeps them out, quarantine reads stale. The fixture's quarantine mutation now hits both the admission and the read, through statistics_quarantined(). Not yet run on hardware in this form; the M5 behaviour is the one measured on the J815 before the A18 Pro protocol work. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <nekreshen@yandex.ru>
m0d16l14n1
force-pushed
the
j815/g17-m5-stats-v2
branch
from
November 14, 2026 11:41
2fc8086 to
99daf59
Compare
Contributor
Author
|
Rebased on integration/aurora 1f5037a, after #1853. Head is now 99daf59, still two commits. #1853 moved the M5 decoder onto
Host tests ( |
This was referenced Nov 14, 2026
m0d16l14n1
marked this pull request as ready for review
November 15, 2026 04:55
Contributor
Author
|
@DjDeveloperr out of draft (#1611 follow-up). On the J815, pstate stays valid across the ~95 power gates per second under load (36/36 records), and busy_ns tracks fdinfo engine time. Green and mergeable; please review. Assisted-by: Claude Opus 5.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The follow-up to #1611 that @DjDeveloperr asked for in this review, reworked from the two commits I offered there (8c58f1d, 2c515ec). Two commits on integration/aurora.
The problem
On a J815 (M5) under a frame-paced load (es2gears + vkcube, 20 s), the cores power-gate about 95 times a second (
power_epoch10861), usually with one utilisation record per power epoch.busy_nsstayed 0 although the 0x13 records kept arriving:busy_ts);What changed from the earlier commits, by review point
busy_mark). Power gates, suspend and restarts keep it. A record at or before the mark adds nothing, so an older queued record, a repeat, or the other role's record for the same time is never credited twice in any drain order. This also covers drm/asahi: g17: M5: report the performance state, its frequency and busy time #1611's note 3 (one baseline for both roles).record_busy()takes 0x13 records that a power boundary kept out, and nothing else. The utilisation average, its delivery cadence and the performance state never see them. Suspend, a real invalidation's discard and quarantine still keep everything out.record_timed()path into the publisher. drm/asahi: g17: A18 Pro: report the performance state, its frequency and busy time #1853 changes the gated reading separately.gpu_power_gatedand no per-pstate residency. Nothing new in the common formatter, so G16S/G17P output doesn't change.asahi-usage-stats.rstnow describe the mark, the one-period rule and the busy-only path. They also fix "Tick deltas are never accumulated…" (drm/asahi: g17: M5: report the performance state, its frequency and busy time #1611 note 4: it is about tag 0x10).busy_nsreadsstaleonce a statistics ring is quarantined (drm/asahi: g17: M5: report the performance state, its frequency and busy time #1611 note 2), instead of a frozen value that reads valid.stale/unavailableforpstateandachieved_frequency_hzinstead ofunsupported. Where pstate is unsupported, output is byte for byte the same, which includes every non-M5 G16S/G17P firmware throughqualify().Credited windows never overlap and each ends at its own record's timestamp, so
busy_nsstays bounded by elapsed time.Testing
tools/asahi/run-host-tests.py --only telemetry13/13, on each commit separately.record_busydropped (in the decoder or in the ring), andrecord_busywithout the percentage check.quarantinemutation still fails: the admission and the read sharestatistics_quarantined().aurora.kobuilds (LLVM, Rust 1.99) with no warnings in these files.agx_statsand fdinfo under the same es2gears + vkcube load, plusbusy_nsagainst the commands' own execution intervals fromasahi_g17_report/asahi_g17_completetraces (as drm/asahi: g17: A18 Pro: report the performance state, its frequency and busy time #1853 did on the J700).With #1853
These two commits conflict textually with #1853, since both rework
telemetry.rs, the ABI doc and the formatter. I've rebased them onto #1853 atj815/g17-m5-stats-v2-on-1853, host tests 13/13 there. On that base the rule uses the firmware's own period, so it covers the A18 Pro's 16 ms records too. #1853's A18 Pro case then expects one 16 ms period after its >2-period gap instead of nothing. Whichever lands second, I'll switch this PR to match.Assisted-by: Claude Opus 5.5