Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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. |
Summary
IoPriotype to the ev layer (u16on io_uring,voidon other backends)iopriofield toFileRead/FileWritecompletions, wired tosqe.ioprioin the io_uring backendReadOptions/WriteOptionstoFile.readBuf/File.writeBufiopriofield toFileReader/FileWriter, threaded through all vtable I/O operationsThis 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