Sample Header Ad - 728x90

Why does io_uring have a layer of indirection for the submission queue?

4 votes
1 answer
632 views
From the [paper on io_uring](https://kernel.dk/io_uring.pdf) , the submission ring contains indices into a submission array, where the submission event itself is stored. The documentation explains this layer of indirection as follows: > One important difference is that while the CQ ring is directly indexing the shared array of cqes, the submission side has an indirection array between them. Hence the submission side ring buffer is an index into this array, which in turn contains the index into the sqes. This might initially seem odd and confusing, but there's some reasoning behind it. Some applications may embed request units inside internal data structures, and this allows them the flexibility to do so while retaining the ability to submit multiple sqes in one operation. That in turns allows for easier conversion of said applications to the io_uring interface. But I'm not following what is meant by "applications may embed request units inside internal data structures", nor do I follow the intuition about what the layer of indirection therefore enables. Can someone explain in other words what this layer of indirection benefits?
Asked by perpetual_check (211 rep)
Oct 20, 2020, 05:33 PM
Last activity: Oct 23, 2020, 04:49 PM