Repository navigation
Revert "drm/asahi: drain deferred BO cleanup after immediate GEM close" - #1885
Conversation
This reverts commit f8a5379. That commit added a synchronous self.bo_deferred_cleanup() to drop_mappings_now(), the immediate GEM-close path, so that an imported object's final VM-BO put is reclaimed at close instead of on a later deferred-cleanup pass. The deferred cleanup list exists precisely so a BO's backing and GPUVM mappings are freed at a firmware-quiescent point: GEM close is not such a point. Draining it there frees and unmaps memory the GPU firmware may still be storing through for in-flight work, so the firmware stores through a stale/unmapped GPUVA and takes a data abort with a wild FAR, wedging the GPU. Reproduced on a J314/J316 (M1 Pro, G13S) under sustained Vulkan CTS with the shipped Mesa: an intermittent RTKit EL1t data abort (ESR 0x96000004), FAR non-canonical and different each time (e.g. 0x5000000000, 0x14bd48..., 0x72800ffffffa0), GPU wedged until reboot, about once per two full mustpass passes. A/B on the fleet73 base (integration 17a7c5f), shipped Mesa held constant: with this commit present, 2 crashes in ~3 mustpass passes, and a kernel with the unrelated g13 stamp-lifecycle commit 88aa658 reverted (this commit still present) crashed again on its second pass; with this commit reverted (88aa658 kept) 3 full back-to-back mustpass passes (4,412,154 cases) ran with zero firmware crashes. Reverting restores the firmware-safe deferred free. The dma-buf import retention this commit targeted (Anees Iqbal, linux-aurora#458) is a delayed free, not a leak, and should be re-addressed by triggering the deferred cleanup from a firmware-completion/idle point rather than from GEM close. Reported-by: Anees Iqbal <[email protected]> Link: omacom/linux-aurora#458 Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Soak follow-up on an M1 Pro (T6000, G13S), production shipped Mesa 26.3.0-23 (ICD 1.4.363), full Vulkan Ran 4 more full passes on the kernel with this revert applied (integration 17a7c5f + revert of f8a5379, keeping 88aa658; source 456f03f7), one-shot boot, no other change:
5,882,872 cases, 0 GPU firmware crashes, 0 GPU wedges, no Combined with the earlier 3 clean passes on the same kernel: 7 full passes, 10,295,026 cases, 0 GPU firmware crashes. The un-reverted kernel takes this fault about once per two passes (EL1t data abort, ESR 0x96000004, wild non-canonical FAR, GPU wedged until reboot). Probability of 0 crashes across 7 passes if the revert made no difference is ~3% at that rate (~97% confidence; ~99.5% at the higher observed rate of ~0.75/pass). A sibling kernel that reverts only the other suspect (88aa658) while keeping f8a5379 still crashed with the same wild-FAR signature, so f8a5379 is the differentiator. |
Revert "drm/asahi: drain deferred BO cleanup after immediate GEM close" (f8a5379).
Symptom
On a J314/J316 (M1 Pro, G13S), under sustained Vulkan CTS with the shipped Mesa, the GPU firmware takes an intermittent RTKit EL1t data abort: ESR
0x96000004, FAR non-canonical and different each time (e.g.0x5000000000,0x14bd48...,0x72800ffffffa0), and the GPU wedges until reboot. Rate is about one crash per two full mustpass passes.Mechanism
f8a5379 added a synchronous
self.bo_deferred_cleanup()todrop_mappings_now(), the immediate GEM-close path, so an imported object's final VM-BO put is reclaimed at close instead of on a later deferred pass.The deferred-cleanup list exists so a BO's backing and GPUVM mappings are freed at a firmware-quiescent point. GEM close is not such a point: draining there frees and unmaps memory the firmware may still be storing through for in-flight work. The firmware then stores through a stale/unmapped GPUVA and faults with a wild FAR, wedging the GPU.
A/B
fleet73 base (integration
17a7c5fa), shipped Mesa held constant, 1 pass = 246 chunks / 1,470,718 cases:0x5000000000,0x14bd48...)0x72800ffffffa0) — 88aa658 is not the cause88aa658 is exonerated and kept; reverting f8a5379 restores the firmware-safe deferred free.
Follow-up
The dma-buf import retention f8a5379 targeted (linux-aurora#458) is a delayed free, not a leak. It should be re-addressed by triggering the deferred cleanup from a firmware-completion/idle point rather than from GEM close.
Host tests
tools/asahi/run-host-tests.py319/319 pass;apple-dcpselftests 88 ok / 0 not ok. (The revert removesgem-close-cleanup-tests.py, which exercised the reverted code path, dropping the host-test count from 323 to 319.)