io_uring: add opcodes, CQ backlog, cancellable poll, timer-based timeout#1408
Open
gburd wants to merge 1 commit into
Open
io_uring: add opcodes, CQ backlog, cancellable poll, timer-based timeout#1408gburd wants to merge 1 commit into
gburd wants to merge 1 commit into
Conversation
Port the Axis-1/2/3 enhancement onto the hardened core/io_uring.cc base: - Opcodes: FTRUNCATE, SPLICE, SYNC_FILE_RANGE, READ_FIXED/WRITE_FIXED, MSG_RING; opcode table extended to IORING_OP_LAST. - CQ overflow: replace drop-and-count with a std::deque backlog (IORING_FEAT_NODROP) drained via flush_cq_overflow_locked() and a centralized io_uring_post_cqe_locked(); SQ CQ_OVERFLOW flag tracked. - POLL_ADD: sliced 100ms cancellable ::poll honoring thread interruption and shutdown so POLL_REMOVE/ASYNC_CANCEL yield -ECANCELED. - TIMEOUT: io_uring_deadline() (ABS/BOOTTIME/REALTIME) with sched::timer and the wait_cq waitqueue, replacing the 1ms busy-poll; keeps the NULL/negative timespec validation from the hardening pass. - EXT_ARG enter timeout, feature-bit honesty, R_DISABLED gating, and IOWQ_MAX_WORKERS reporting. Ring head/tail/flags reads/writes use the io_uring_au32 atomic member API; the Linux-ABI buf_ring tail stays a plain uint16_t accessed via __atomic builtins. Builds and boots; tests/tst-io_uring.cc (all opcode and fidelity cases) passes under x86_64.
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.
Summary
Builds on the merged
core/io_uring.ccbase to close fidelity gaps against the Linux io_uring ABI:FTRUNCATE,SPLICE,SYNC_FILE_RANGE,READ_FIXED/WRITE_FIXED, andMSG_RING; the opcode table is extended toIORING_OP_LAST.std::dequebacklog (IORING_FEAT_NODROP), drained viaflush_cq_overflow_locked()through a centralizedio_uring_post_cqe_locked(); the SQCQ_OVERFLOWflag is tracked.::pollthat honors thread interruption and ring shutdown soPOLL_REMOVE/ASYNC_CANCELyield-ECANCELED.io_uring_deadline()(ABS/BOOTTIME/REALTIME) backed bysched::timerand thewait_cqwaitqueue, replacing the 1ms busy-poll while keeping the NULL/negative-timespec validation from the hardening pass.EXT_ARGenter timeout, feature-bit honesty,R_DISABLEDgating, andIOWQ_MAX_WORKERSreporting.Ring head/tail/flags reads/writes use the
io_uring_au32atomic member API; the Linux-ABIbuf_ringtail stays a plainuint16_taccessed via__atomicbuiltins.Test plan
core/io_uring.cccompiles clean against the enhancedinclude/osv/io_uring.h.tests/tst-io_uring.cc(all opcode and fidelity cases) compiles clean and passes under x86_64.