Repository navigation
drm/asahi: g17: count busy time across power gates, in timestamp order (#1611 follow-up) - #1879
m0d16l14n1 wants to merge 2 commits into
Conversation
2fc8086 to
99daf59
Compare
|
Rebased on integration/aurora 1f5037a, after #1853. Head is now 99daf59, still two commits. #1853 moved the M5 decoder onto
Host tests ( |
|
@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 |
|
Blockers: 1. I checked the ordering logic in drivers/gpu/drm/asahi/g17/telemetry.rs:288-305. The
HW row: the J815 comment reports pstate valid across gates (36/36) and busy_ns tracking fdinfo, but gives no numbers. Post busy_ns delta against the fdinfo engine-time delta over the 20 s es2gears + vkcube run (ratio, and power_epoch count). The A18 Pro now uses the new gap rule too, so run the same on a Neo. Pass criteria: busy_ns within a few percent of fdinfo, never above elapsed time, and the regression line showing 0 failed units, 0 SELinux denials and 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
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". Signed-off-by: Nick <nekreshen@yandex.ru>
6440b4c to
4f86a73
Compare
|
@RyanTheTide fixed.
Rebased onto cc14570, and Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of 4f86a73: No blockers. Earlier points:
What changed since: only the rebase bound above. The other differences in channel.rs and sysfs.c come from the new base. I found no problems.
HW row (still open): over the 20 s es2gears + vkcube run on a J815 and on a Neo, the busy_ns delta against the fdinfo engine-time delta (ratio, and the power_epoch count). It passes if busy_ns is within a few percent of fdinfo, never above elapsed time, with 0 failed units, 0 SELinux denials and 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
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 further behind the mark than a full statistics ring of utilisation records (256 x the record interval, twice over: 4.1 s at 8 ms, 8.2 s at 16 ms) 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. Signed-off-by: Nick <nekreshen@yandex.ru>
4f86a73 to
412fe1e
Compare
|
Re-review of 412fe1e: no blockers. The only change since 4f86a73 is the compile-time check that ties the decoder's ring size to the firmware ring (drivers/gpu/drm/asahi/g17/channel.rs:18-20; both are HW row (still owed, at 412fe1e): run the 20 s es2gears + vkcube load on a J815 and on a Neo, and post the busy_ns delta against the fdinfo engine-time delta (ratio and Assisted-by: LLM (Claude:Opus 5.5) |
|
@RyanTheTide nit done in Checks: The busy_ns against fdinfo rows (J815 and a Neo) are still owed. Assisted-by: LLM (Claude:Opus 5.5) |
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.Changed on this head (review)
Protocol::rebase_ticks()is a full statistics ring (STATISTICS_SLOTS, 256) of the other role's utilisation records, one per interval, times two for margin: 4.1 s on the M5 (8 ms) and 8.2 s on the A18 Pro (16 ms). It follows the protocol's own period.integration/auroracc14570. Both commits carry only mySigned-off-by.aurora.kobuilds at each commit withW=1, with no new warnings. The Rust warnings it prints are the same at both commits and come from elsewhere in the driver.STATISTICS_RING_RECORDS(256, the same asfw::channels::STATISTICS_SLOTS), sotelemetry.rsstill builds on its own for the host tests.tools/asahi/run-host-tests.py --only telemetrypasses 13/13 on this head,4f86a73e, including the clock-restart case and every mutant.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.Still owed (HW rows): the
busy_nsdelta against the fdinfo engine-time delta over the 20 s es2gears + vkcube run on the J815 (ratio, and thepower_epochcount). The same on an A18 Pro (Neo), which now uses the new gap rule too. Pass:busy_nswithin a few percent of fdinfo and never above elapsed time; 0 failed units, 0 SELinux denials, 0 new kernel errors.Assisted-by: LLM (Claude:Opus 5.5)