Skip to content

Advantages of io_uring_queue_init_mem #1321

Answered by isilence
AomaYple asked this question in Q&A
Discussion options

You must be logged in to vote

The io_uring_queue_init_mem seems to allocate memory by the user and then put multiple rings under the same block of memory.

CQ/SQ rings of different io_uring instances are not shared. Passing the same chunk of memory to multiple io_uring_queue_init_mem (without killing previous instances) would be a bug. However, you can chunk, let's say, a huge page into non-overlapping buffers and pass them to different rings.

What is the advantage of this? Suppose it's meant to be cache friendly, which means that an extra-large block of memory must be allocated beforehand to hold multiple rings.

Right, the manual tells about it.

# man io_uring_queue_init_mem.3

... Typically, the caller should all…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AomaYple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants