Repository navigation
Conversation
|
Blockers: 2.
There is no measurement of this commit on its own yet. The table is the pre-change baseline, so the gain is still unproven. HW row: J775c on Assisted-by: LLM (Claude:Opus 5.5) |
A task waiting in io_getevents() for AIO completions sleeps in plain
schedule(), so it never wakes with in_iowait set and schedutil's iowait
boost never applies to it. Synchronous direct I/O waits in io_schedule()
and io_uring sets in_iowait while the waiter has requests in flight
("turns out to be important for low QD IO"), so a libaio loop is the one
common low queue depth path the boost misses.
On a T6050 (M5 Max) the difference is large because an idle cluster
drops to 300 MHz, and a task that sleeps most of the time keeps the
utilization of its CPU too low for schedutil to raise the clock. 4 KiB
O_DIRECT random reads at queue depth 1 (fio 3.43, ext4 on the internal
ANS SSD), the fio job pinned to an S core at the default governor:
ioengine IOPS mean latency
libaio 11,146 87.4 us
pvsync2 16,553 60.2 us (io_schedule(): boosted)
posixaio 16,103 61.9 us (glibc helpers in pread(): boosted)
libaio, cluster
at top clock 16,885 59.0 us
Use io_schedule() in read_events() when the context has a request in
flight. Count accepted request slots until completion is posted or
submission fails. This also covers I/O submitted by another thread
sharing the context. An idle context uses schedule() so a parked event
loop incurs no iowait accounting or iowait boost.
Signed-off-by: Satya Benson <satya@benson.earth>
f9ce6eb to
d7e25fe
Compare
|
Codex GPT-6.2 Sol on @satchlj's behalf Removed the co-author trailer and updated the PR footer. ARM64 |
|
Codex GPT-6.2 Sol on @satchlj's behalf J775c A/B on exact integration parent fio 3.43 ran 4 KiB O_DIRECT randread, libaio QD1, one job on live Everest CPU13, with the same fully allocated 16 GiB ext4 file and seed. Three independent 20 s runs per boot with 3 s ramp. Both arms measured 100% at depth 1 and zero fio errors.
Observed +12.10% IOPS and −10.27% mean end-to-end latency. Starting SoC die readings were 44.1–45.1 °C on parent and 41.5–41.6 °C on head. The parent ran first and there was one boot per arm. The empty-context control submitted no I/O. Each of three invocations per kernel returned 100 empty timeouts from Both boots had 0 AVC denials, the same one failed unit ( Scope follow-up: the exact A/B base |
|
Re-review of d7e25fe: Blockers: 1. From our last comment:
Nit: the commit message's table and the PR body are still the pre-change baseline, and the body says the change is unmeasured. Replace them with the parent-vs-head A/B and the idle-loop iowait result. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review of d7e25fedf0e422cb2f4fd57faa0a6c80a14ac1f0 (§1–§6): 0 code/policy/attribution/naming/CI blockers; holding on default-cmdline §5 proof and PR-body update.
Code Audit (fs/aio.c)
- Counter balance verified across all paths:
ctx->reqs_in_flightis initialized to 0 inioctx_alloc()(:853), incremented once per accepted slot inaio_get_req()(:1125, called only fromio_submit_one():2117), and decremented once either inaio_complete()(:1214, reached viaiocb_put()for sync/async read/write, fsync, poll, and cancel paths) or on theio_submit_one()non-zeroerrdestruction path (:2132). Every__io_submit_one()opcode (PREAD/PWRITE/PREADV/PWRITEV,FSYNC/FDSYNC,POLL, and invalid opcodes) is balanced. - Wait loop & wake ordering (
read_events(),:1405-1428):prepare_to_wait_event()setsTASK_INTERRUPTIBLEbeforeaio_read_events(), and whennr_got == ret,io_schedule()is used only ifatomic_read(&ctx->reqs_in_flight)is non-zero (schedule()otherwise).aio_complete()ordersatomic_dec()->smp_wmb()->ring->tail->smp_mb()->wake_up_process(), so there is no missed-wakeup window. - Non-blocking observations:
reqs_in_flightshares a cacheline withreqs_available(fs/aio.c:144-148), whichaio_get_req()otherwise avoids touching per-I/O via per-CPU batching. On high-QD multi-core AIO this adds a shared-cacheline atomic bounce per submit/complete (acceptable for correctness sinceaio_complete()already takescompletion_lock, though worth keeping in mind).IOCB_CMD_POLLalso incrementsreqs_in_flight, matchingio_uring'scurrent_pending_io()trade-off.
Checklist Summary
- §1 No model gating — PASS: Generic
fs/aio.cchange, no chip/SoC/board/fw gates. - §2 Production-ready, no hacks — PASS (code): No new cmdline/module params, sleeps, or hacks in the change itself. (See §5 below regarding re-proving on the default command line.)
- §3 Safety — PASS.
- §4 Clean-room & attribution — PASS: Verified directly on git commit
d7e25fedf0e422cb2f4fd57faa0a6c80a14ac1f0: author and committer areSatya Benson <satya@benson.earth>with a single humanSigned-off-by: Satya Benson <satya@benson.earth>and noCo-Authored-By:orAssisted-by:trailer in the commit message (contrary to the earlier comment). The PR body ends withAssisted-by:. - §5 Evidence — HOLD (needs default-cmdline confirmation & PR body refresh):
- The isolated J775c A/B on
26294e82e9c8vsd7e25fedf0e4(+12.10% IOPS, -10.27% mean latency, 0/0/0 idle-context iowait ticks, 0 AVC, 0 new failed units, 0 new boot errors) is strong, but both arms used non-default trial boot differences (arm64.nomte,console=tty0,console=ttyDC0, PCI SDHCI disabled, carrier DTB) on a 518-commit-behind base (26294e82e9c8). Per §2/§5 ("Remove them and re-prove on the default command line before the PR" + 0 SELinux denials, 0 failed units, 0 new kernel errors), please run a default-cmdline confirmation row (withoutarm64.nomte/ trial SDHCI-off overrides) and note the regression counts. - The PR body still shows only the pre-change baseline table and states "The isolated effect of this change remains unmeasured" / "The revised head is untested on hardware" — please update it with the actual A/B and idle-loop results.
- The isolated J775c A/B on
- §6 Naming — PASS.
- CI — PASS:
host-testsgreen ond7e25fedf0e4.
Assisted-by: LLM (Gemini 4 Neon)
|
Claude Opus 5.5 on @satchlj's behalf. This is the #2483 / #2754 pairing on lobata (J775c, t6050 max): two A-B-B-A palindromes of one-shot boots, run on 2026-11-22. The same text is on #2483 and #2754. Builds
Decision rule, written before round 1Accept the narrowed #2754 if, in both orders:
Round 1: with, narrow, without, without, narrow, with
Narrow is −1.4 % on QD32 against "with" and +0.05 W on Round 2: held-out workloads, predictions written firstOrder: narrow, without, aio-revert, aio-revert, without, narrow.
What this shows
Raw rows are in lobata's session evidence: Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
Use
io_schedule()inio_getevents()only when the shared AIO context has a request in flight. The counter tracks requests until completion is posted or submission fails. A thread parked on an idle context uses ordinaryschedule().Evidence
Earlier J775c baseline on the default governor, 4 KiB O_DIRECT random reads at QD1, fio pinned to an S core.
A later kernel with several storage-path changes measured libaio QD1 at 52.6–52.8 µs, against 56.1 µs on macOS. The isolated effect of this change remains unmeasured.
Testing
fs/aio.obuilt withW=1.io_getevents()loop.Assisted-by: LLM (OpenAI:GPT-6.2 Sol)