Repository navigation
drm/asahi: g17: walk only uncovered ranges when validating a submission - #658
Conversation
|
Reviewed for the M4 merge train. Two things:
After that we'll run it on the J616s and the Neo. |
|
Paired benchmark is in the description, with the method, per-round numbers and variance. Short version: The |
|
Merge train (MTL, 06/11): can't take this yet. Commit 5f0c7fc ("drm/asahi: g17: walk only uncovered ranges when validating a submission") has no |
The per-queue Proof skips the page-table walk only when it covers every range a submission names. Otherwise the whole request set is walked again, and every GPUVM map step moves the mapping epoch, which discards all cached proofs. Mesa records each frame's commands into command-buffer chunks at fresh addresses, so nearly every submission names at least one range the proof has not seen. Each of those re-walks every range in the submission, including the render targets: thousands of pages per full-resolution attachment, under the GPUVM exec lock. Under an unchanged epoch the cached proofs still hold, so walk only the ranges they do not cover and record the whole request set as before. If the epoch moved between the cache check and the walk, walk everything, as before. A GPUVM map step only maps addresses nothing maps yet: GPUVM runs the unmap and remap steps for any overlap first, and those remain full mutations. Every range a proof covers therefore stays mapped across a map step, so it no longer advances the epoch. Cached validation still pauses while the step's leaf writes are in flight. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
a9e3886 to
8d88d95
Compare
|
Signed off and force-pushed: one commit now, on 565c802, so the merge commit is gone and the tree is unchanged. |
|
Merge train (MTR, 06/11): merging, now signed off. I gave this an adversarial review because it decides what a submission may touch:
The Neo (G17P) ran vkcube and glmark2 on it with no GPU faults or recoveries. Gates: test merge 2d3579ef = integration/aurora 11eccbe + #1005 #994 #930 #658 #992 #1006 #1007 #1008 #531 (#992 has since landed on its own); base 11eccbe.
Hardware (7.3.0-aurora-mtr1106a, one-shot boots, fleet recipe):
|
The per-queue
Proofing17/validation.rsskips the page-table walk only when it covers every range a submission names. Otherwise the whole request set is walked again. On top of that, every GPUVM map step moves the mapping epoch, which throws away all cached proofs.Mesa records each frame's commands into command-buffer chunks at fresh addresses, so nearly every submission names at least one range the proof hasn't seen yet. Each of those submissions re-walks everything it names, render targets included: thousands of pages per full-resolution attachment, under the GPUVM exec lock.
Change
validate()walks only the ranges they don't cover (Proof::uncovered), then records the whole request set exactly as before. If the epoch moved between the cache check and the walk, it falls back to walking everything, as before.sm_step_mapnow usesmapping_addition(). That keeps the epoch value and still pauses cached validation while the step's leaf writes are in flight.Failure behaviour is unchanged: a range that isn't mapped still drops to per-range checked validation.
Testing
asahi_g17_validation_pages:only_uncovered_ranges_are_walked_again: covered, partially covered, and stronger-access ranges.a_partial_walk_extends_the_proof: after recording, the proof covers the union and stays epoch-bound.Requests/Proofcode.drivers/gpu/drm/asahibuilds onintegration/aurora(23827fe87f4f) withtools/aurora-bindgen, with no new warnings.Benchmark
Result: the part this changes gets about 31 % faster and walks about 97 % less, but in this microbench that is too small to move total CPU time or wall time beyond run-to-run noise.
Proof::validate()time per submissionPaired by round (mean of round differences, sd over 8 rounds): validation -3.64 us (sd 0.66), system CPU -1.69 us (sd 2.20), wall -0.08 us (sd 0.11). So the validation gain is clear, the system CPU change is within noise, and wall time doesn't change.
Walk kinds, 480,336 submissions each way: before 0 hits, 0 partial, 480,336 full; after 389 hits, 479,915 partial, 32 full.
Method
integration/aurorahas no T6041 GPU yet, so this isn't that tree: the kernel is our 7.2.10 J616C tree with our T6041 driver port, with this PR'sg17/validation.rsdropped in.g17_val_partial_walkand counters aroundvalidate()(ktime_get_ns()). The port already hasg17_val_additive, which turnsmapping_addition()back into a full mutation. Both off is the base logic ("before": it walks every range when any is uncovered, and every map step moves the epoch), both on is this PR ("after"). The bench hooks aren't in this PR.ru_utime/ru_stimefromwait4(). The clock wasn't pinned.Limits