Skip to content

Implement nvme - #140

Draft
Virv12 wants to merge 3 commits into
masterfrom
nvme
Draft

Virv12 wants to merge 3 commits into
masterfrom
nvme

Conversation

@Virv12

@Virv12 Virv12 commented Sep 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@Virv12
Virv12 force-pushed the nvme branch 2 times, most recently from 4a2a219 to bfca8fd Compare September 8, 2026 22:31
Virv12 and others added 3 commits September 9, 2026 01:38
wait_ready and submit busy-waited with uefi::boot::stall in a tight
loop, blocking the whole single-threaded cooperative executor for up
to ~10s on every controller state change and NVMe command completion.
Replace that with the same wait_for_interrupt()/sleep() cooperative
wait net_poll already uses, so other tasks (network, UI, input) keep
running during disk I/O.

A synchronous fallback (submit_sync/wait_ready_sync/transfer_sync) is
kept for the sync GPT-parsing path (gpt_disk_io::BlockIo can't await)
and for Drop teardown, which can't be async either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYnqytnV7A4KAdLkgqw1fD
Executor::sleep()/wait_for_interrupt() only re-check their condition
when the executor wakes from hlt for some interrupt, and nothing wires
up a real interrupt for this controller, so select(wait_for_interrupt,
sleep(10us)) gave no real latency bound: each retry could block far
longer than 10us waiting for an unrelated interrupt to fire at all,
turning tens of thousands of small NVMe commands during a store/flash
into a multi-minute operation instead of ~10s.

Use Executor::sched_yield() instead: it re-queues the task and gets
re-polled on the executor's very next pass, so it stays about as fast
as the original busy-wait while still interleaving with other ready
tasks. Since sched_yield's iteration cost is no longer a fixed
duration, bound the retry loop by wall-clock time (Timer::micros(), a
plain TSC read) rather than a fixed iteration count.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYnqytnV7A4KAdLkgqw1fD

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant