-
Lets say I have created an array of iovec of 10 size by - After initialising this array I have called io_uring_prep_readv and initialised the sqe with the address of iovec array (iov_array) . And then I have successfully submitted this sqe by calling io_uring_submit. Now can I delete this iovec array ( free(iov_array)) or do I have to wait until I receive the completion event from the kernel corresponding to this sqe to delete this array? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You may delete the iovec array when the IO has been submitted (rather than wait until it's completed) if the following conditions are true:
This also means that you don't need to allocate this array from the heap if you're just preparing it for submit, you could have it on the stack as long as it's valid across submission. |
Beta Was this translation helpful? Give feedback.
You may delete the iovec array when the IO has been submitted (rather than wait until it's completed) if the following conditions are true:
IORING_SETUP_SQPOLL
. The iovec must be stable until the IO has been submitted, and you cannot know for sure when that happens when kernel side submission polling is used.IORING_FEAT_SUBMIT_STABLE
inio_uring_params->features
when the ring has been setup. This has been the case since kernel 5.5, so not a recent change.This also means that you don't need to allocate this array from the heap if you're just preparing it for submit, you could have it on the stack as long as it's valid across submi…