Skip to content

Add per-request I/O priority (ioprio) support#333

Draft
lalinsky wants to merge 2 commits intomainfrom
ioprio
Draft

Add per-request I/O priority (ioprio) support#333
lalinsky wants to merge 2 commits intomainfrom
ioprio

Conversation

@lalinsky
Copy link
Copy Markdown
Owner

Summary

  • Add IoPrio type to the ev layer (u16 on io_uring, void on other backends)
  • Add ioprio field to FileRead/FileWrite completions, wired to sqe.ioprio in the io_uring backend
  • Add ReadOptions/WriteOptions to File.readBuf/File.writeBuf
  • Add ioprio field to FileReader/FileWriter, threaded through all vtable I/O operations

This allows setting per-request block I/O scheduling priority on Linux (respected by bfq and mq-deadline schedulers). Useful for prioritizing reads over background writes in database-style workloads.

Ref: #332

Support per-request I/O priority for file read/write operations.
On io_uring, this sets sqe.ioprio which the kernel's block I/O
scheduler (bfq, mq-deadline) uses to prioritize requests.
On other backends, the field is void.

Ref: #332
File.readBuf and File.writeBuf now accept ReadOptions/WriteOptions
with an ioprio field. FileReader and FileWriter store ioprio and
pass it through on all I/O operations.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ioprio

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@manishrjain
Copy link
Copy Markdown

We should allow setting the priority as per this: https://man7.org/linux/man-pages/man2/ioprio_get.2.html

we have RT, BE, and Idle. And then within those, there's also lower number = higher priority. We could aim to support both of those knobs, or at least one of them - the class one: RT, BE and Idle.

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.

2 participants