Linux IO_uring and block subsystem maintainer Jens Axboe this week queued the patch series for multi-shot support with provided buffers. Thus the feature should go in for Linux 6.18 as another nice enhancement to the wonderful IO_uring kernel innovation.
Ming Lei of Red Hat who led the work on IO_uring multi-shot support with provided buffers explained on the patch series:
“Add UAPI flag IORING_URING_CMD_MULTISHOT for supporting multishot uring_cmd operations with provided buffer.
This enables drivers to post multiple completion events from a single uring_cmd submission, which is useful for:
– Notifying userspace of device events (e.g., interrupt handling)
– Supporting devices with multiple event sources (e.g., multi-queue devices)
– Avoiding the need for device poll() support when events originate from multiple sources device-wideThe implementation adds two new APIs:
– io_uring_cmd_select_buffer(): selects a buffer from the provided buffer group for multishot uring_cmd
– io_uring_mshot_cmd_post_cqe(): posts a CQE after event data is pushed to the provided bufferMultishot uring_cmd must be used with buffer select (IOSQE_BUFFER_SELECT) and is mutually exclusive with IORING_URING_CMD_FIXED for now.”
The main takeaways being this multi-shot support being useful for better supporting some devices like multi-queue hardware and notifying user-space on device events. The very first user of these new APIs is the user-space block device “ublk” driver.
These patches were queued up this week in the linux-block.git’s “for-next” Git branch making it material expected for Linux 6.18 barring any last minute issues from coming up with the code prior to its submission to Linus Torvalds in early October.