Repository navigation
io_uring: register ring fd and reduce code duplication - #2108
Merged
Merged
Conversation
fio_ioring_cmd_queue_init() is identical to fio_ioring_queue_init() except for the additional IORING_SETUP_SQE128 and IORING_SETUP_CQE32 flags. Check for is_uring_cmd_eng in fio_ioring_queue_init() and set these flags accordingly. Replace fio_ioring_cmd_queue_init() with fio_ioring_queue_init(). Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
fio_ioring_cmd_post_init() is identical to fio_ioring_post_init() except for the additional handling of 128-byte SQEs. Check for is_uring_cmd_eng in fio_ioring_post_init() and adjust the SQE size accordingly. Replace fio_ioring_cmd_post_init() with fio_ioring_post_init(). Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Try to issue IORING_REGISTER_RING_FDS in io_uring queue initialization to register the io_uring's own file descriptor. Use the registered ring fd with IORING_ENTER_REGISTERED_RING for all io_uring_enter() syscalls. This improves performance by avoiding the io_uring file descriptor reference-counting overhead on each io_uring_enter() syscall. IORING_REGISTER_RING_FDS isn't supported on older kernels, so fall back to the existing behavior of passing io_uring_enter() a raw fd if the registration fails. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
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.
Try to issue
IORING_REGISTER_RING_FDSin io_uring queue initialization to register the io_uring's own file descriptor. Use the registered ring fd withIORING_ENTER_REGISTERED_RINGfor allio_uring_enter()syscalls. This improves performance by avoiding the io_uring file descriptor reference-counting overhead on eachio_uring_enter()syscall.IORING_REGISTER_RING_FDSisn't supported on older kernels, so fall back to the existing behavior of passingio_uring_enter()a raw fd if the registration fails.Also consolidate some initialization functions largely duplicated between the
io_uringandio_uring_cmdengines.