Skip to content

How do people generally approach lifetimes of allocations #964

Answered by axboe
CharlieTap asked this question in Q&A
Discussion options

You must be logged in to vote

Most requests will follow the guarantee that any meta data structures (like the iovec for a read/write, for example) must remain stable until submission has been done. This means until io_uring_submit() returns. For SQPOLL, it's not possible for the application to know when the request has been consumed by the kernel thread, so for that case, data structures need to remain stable until the CQE for the given request has been posted.

Basically liburing caches the SQ ring tail, preventing SQPOLL or just the kernel in general from seeing request that have been prepared with a sequence of io_uring_get_sqe() + io_uring_prep_foo(sqe). Once io_uring_submit() is called, it calls __io_uring_sq_flus…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by CharlieTap
Comment options

You must be logged in to vote
2 replies
@noteflakes
Comment options

@cmazakas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants