Repository navigation
perf(io): consume the receive buffer ring incrementally - #164
Merged
Merged
Conversation
The branch carries the io_uring changes the receive path needs ahead of a compio release: IORING_CQE_F_BUF_MORE through Extra, a buffer pool that recycles incrementally consumed buffers only once the kernel is done, the second half of 32-byte CQEs and zero-copy notification results.
A multishot receive used a whole ring buffer per completion, however few bytes arrived. On a ring registered with IOU_PBUF_RING_INC the kernel now fills a buffer across completions, so small reads share a buffer instead of draining the ring; compio lends each read its part and recycles the buffer once the kernel is done and every part is released. Kernels before 6.12 reject the flag at registration, and the ring consumes whole buffers. The ring tests run on both consumption modes, and a new test checks that consecutive small reads of a connection continue in one buffer. Closes #163
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the compio dependency onto the
skyzenbranch of a compio fork (v0.19.2 plus the changes offered upstream as compio-rs/compio#1140, #1141 and #1142, and one more for incremental consumption), and receives through an incrementally consumed ring where the kernel supports it.On such a ring (
IOU_PBUF_RING_INC, Linux 6.12) a completion lends only the bytes it filled, starting where the previous completion into that buffer ended, and the buffer goes back to the ring only once a completion withoutIORING_CQE_F_BUF_MOREtook it out and the last reference into it drops. A kernel that rejects the flag gets whole-buffer consumption, decided by compio when the ring registers. The ring tests run on both paths; a new one holds eight 16-byte reads from a two-buffer ring and checks each starts where the previous ended.Closes #163