Repository navigation
Conversation
The M3 runtime publishes one render pass at a time unless asahi.m3_render_batch_size or the writable m3_render_batch_override asks for more. On a J615 (15-inch M3 MacBook Air) that costs frames while Chromium scrolls an image-heavy page. Make the boot default 2. Measured on a J615 with the stock 7.2.11 aurora16 module, whose next_batch() and render_batch_size() match this tree's, booted with asahi.t8122_pstate_cap=5 and setting m3_render_batch_override at runtime. Chromium images scene, median of three runs: batch dropped frames p99 frame interval 1 2.2 % 33.3 ms 2 0 % 16.7 ms 4 0.1 % 16.7 ms Two same-session control runs at batch 1 dropped 2.6 % and 2.4 %. With 2, a burst of eight glprobe draws retired 1.6 render commands per retirement instead of 1.0, its median fell from 4.53 ms to 4.00 ms and GPU mailbox interrupts per run fell from 320 to 200. gpubench throughput and idle power stayed within noise. The kernel log had no GPU errors. Only T8122 is affected. This parameter exists only with CONFIG_DRM_ASAHI_M3_T8122, its only reader is the runtime's next_batch(), the runtime's only SoC table is T8122 and it starts only on the J613 and J615. T6030 and T6031 keep the G15 backend or the probe refusal. The first render draw is still published alone for InitBM, and the T8122 pipeline depth of 2 and the 4000 us batch budget still bound every batch. m3_render_batch_override=1 restores the old behaviour at runtime, asahi.m3_render_batch_size=1 at boot. The J613 runs the same runtime and gets the same default but was not tested, and neither was the default asahi.t8122_pstate_cap of 2. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TqFXgsntBCgau1RkXP1KRQ Signed-off-by: Fredrik Silfver <1684291+freber@users.noreply.github.com>
|
Claude Code wrote this up from my tests. I repeated the A/B with 7.3 on my J615 (15-inch M3 Air). The kernel is integration/aurora The gain depends on the CPU governor. Under schedutil, which the balanced and power-saver profiles use, batch 2 cuts dropped frames by about a quarter. Under the performance governor neither size drops any.
The schedutil runs were on a kernel without #2199, where every profile ends up on schedutil. The performance runs had #2199 added. The first performance pair ran a few minutes after boot and both sizes sat at 42 ms there. In an earlier boot where the memory floor from #1985 had stopped, the schedutil A/B gave 23.7, 17.3, 23.2 and 17.0 % dropped frames. gpubench throughput didn't move (batch 1 320 fps against batch 2 312 fps in the same hour), as on 7.2. |
Claude Code wrote this up from my tests.
asahi.m3_render_batch_sizegoes from 1 to 2, so the M3 runtime publishes up to two render passes per batch by default. The sysfs overridem3_render_batch_overridestill wins when it's set.Only the M3 Airs are affected. The parameter exists only with
CONFIG_DRM_ASAHI_M3_T8122and its one reader isnext_batch()inm3_runtime.rs. That runtime starts on the J613 and J615 and nowhere else. M3 Pro and Max (T6030, T6031) go to the G15 backend or get refused and never read it.The first render draw is still published alone for InitBM. The T8122 pipeline depth of 2 and the 4000 µs batch budget cap every batch as before.
Why
On my J615 (15-inch M3 MacBook Air) Chromium drops frames when it scrolls an image-heavy page at batch 1. I measured it on 14 November with the stock aurora16 module and changed only
m3_render_batch_overrideat runtime. The page is about 21000 px tall with 101 images and a synthetic scroll runs down and back up for 20 s. Each row is the median of three runs.Two control runs at batch 1 in the same session dropped 2.6 and 2.4 percent. At batch 2 the worst of the three runs dropped a single frame. Frame latency (from vsync until the frame is on screen) fell by one refresh. Batch 4 gave the same frame pacing in Chromium, so I went with the smaller step.
To check that batching happened, I ran a burst of eight small draws. At batch 2 the runtime retired 1.6 render commands per retirement against 1.0 at batch 1. The burst's median fell from 4.53 to 4.00 ms and GPU mailbox interrupts per run dropped from 320 to 200.
Throughput in gpubench held (220.4 fps before, 222.4 after) and idle power didn't rise (7.6 W against 8.3 to 9.1 W in the batch 1 runs, one sample each). The kernel log had no GPU errors during these runs.
Daily use
Batch 2 has been my everyday setting since 14 November at 16:28, through a tmpfiles.d entry that writes the override at boot. That's seven boots so far. The first two ran the stock aurora16 kernel (7.2.11-16-1-ARCH). The other five ran my J615 test kernel (7.2.11-16-1-j615-ARCH), which is aurora16 plus my J615 power and display patches with the same
next_batch().The kernel logged no GPU faults or timeouts in any of those boots. hyprland-preview-share-picker failed once, on the test kernel on 16 November, with these two lines before it crashed in libvulkan_asahi.
The same two lines and the same crash showed up twice on 13 November on the stock kernel at batch 1, before I had changed anything. So I don't think batching causes it.
What I haven't tested
Only my J615 has run this. The J613 (13-inch M3 Air) runs the same runtime and gets the same default, but I don't have one to try it on.
My command line also has
asahi.t8122_pstate_cap=5, so batch 2 at the default cap of 2 is untested.All my measurements used the runtime override. This branch on integration/aurora is host-tested only.
python3 -I tools/asahi/run-host-tests.py --only m3passes 6 of 6 (m3-batching-tests 12, m3-runtime-tests 81, m3-firmware-tests 21 plus the three m3 Python tests). None of them readM3_RENDER_BATCH_SIZE, so they only show that nothing else moved.How to test
On a J613 or J615 you can try it today without this patch.
Then scroll a long page full of images in Chromium. With the patch nothing needs setting. Writing 1 to the override or booting with
asahi.m3_render_batch_size=1goes back to batch 1.I asked about the default on omacom/linux-aurora#385 and didn't hear back, so I'm proposing it here. If anyone has a J613, a run with the override set to 2 would cover the one board I can't test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TqFXgsntBCgau1RkXP1KRQ