History

Merge tag 'for-6.12/io_uring-20240913' of git://git.kernel.dk/linux

Pull io_uring updates from Jens Axboe: - NAPI fixes and cleanups (Pavel, Olivier) - Add support for absolute timeouts (Pavel) - Fixes for io-wq/sqpoll affinities (Felix) - Efficiency improvements for dealing with huge pages (Chenliang) - Support for a minwait mode, where the application essentially has two timouts - one smaller one that defines the batch timeout, and the overall large one similar to what we had before. This enables efficient use of batching based on count + timeout, while still working well with periods of less intensive workloads - Use ITER_UBUF for single segment sends - Add support for incremental buffer consumption. Right now each operation will always consume a full buffer. With incremental consumption, a recv/read operation only consumes the part of the buffer that it needs to satisfy the operation - Add support for GCOV for io_uring, to help retain a high coverage of test to code ratio - Fix regression with ocfs2, where an odd -EOPNOTSUPP wasn't correctly converted to a blocking retry - Add support for cloning registered buffers from one ring to another - Misc cleanups (Anuj, me) * tag 'for-6.12/io_uring-20240913' of git://git.kernel.dk/linux: (35 commits) io_uring: add IORING_REGISTER_COPY_BUFFERS method io_uring/register: provide helper to get io_ring_ctx from 'fd' io_uring/rsrc: add reference count to struct io_mapped_ubuf io_uring/rsrc: clear 'slot' entry upfront io_uring/io-wq: inherit cpuset of cgroup in io worker io_uring/io-wq: do not allow pinning outside of cpuset io_uring/rw: drop -EOPNOTSUPP check in __io_complete_rw_common() io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN io_uring/sqpoll: do not allow pinning outside of cpuset io_uring/eventfd: move refs to refcount_t io_uring: remove unused rsrc_put_fn io_uring: add new line after variable declaration io_uring: add GCOV_PROFILE_URING Kconfig option io_uring/kbuf: add support for incremental buffer consumption io_uring/kbuf: pass in 'len' argument for buffer commit Revert "io_uring: Require zeroed sqe->len on provided-buffers send" io_uring/kbuf: move io_ring_head_to_buf() to kbuf.h io_uring/kbuf: add io_kbuf_commit() helper io_uring/kbuf: shrink nr_iovs/mode in struct buf_sel_arg io_uring: wire up min batch wake timeout ...

Linus Torvalds committed 2 years ago

Commit 3a4d3192 parents 69a3a0a 7cc2a6e20 files · +723 −260Browse files

Showing the changes to include/uapi/linux (1 of 20 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+41−1
@@ -440,11 +440,21 @@ struct io_uring_cqe { · 439 unmodified lines
440440 * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv
441441 * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct
442442 * them from sends.
443+ * IORING_CQE_F_BUF_MORE If set, the buffer ID set in the completion will get
444+ * more completions. In other words, the buffer is being
445+ * partially consumed, and will be used by the kernel for
446+ * more completions. This is only set for buffers used via
447+ * the incremental buffer consumption, as provided by
448+ * a ring buffer setup with IOU_PBUF_RING_INC. For any
449+ * other provided buffer type, all completions with a
450+ * buffer passed back is automatically returned to the
451+ * application.
443452 */
444453 #define IORING_CQE_F_BUFFER (1U << 0)
445454 #define IORING_CQE_F_MORE (1U << 1)
446455 #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
447456 #define IORING_CQE_F_NOTIF (1U << 3)
457+#define IORING_CQE_F_BUF_MORE (1U << 4)
448458
449459 #define IORING_CQE_BUFFER_SHIFT 16
450460
@@ -507,6 +517,7 @@ struct io_cqring_offsets { · 56 unmodified lines
507517 #define IORING_ENTER_SQ_WAIT (1U << 2)
508518 #define IORING_ENTER_EXT_ARG (1U << 3)
509519 #define IORING_ENTER_REGISTERED_RING (1U << 4)
520+#define IORING_ENTER_ABS_TIMER (1U << 5)
510521
511522 /*
512523 * Passed in for io_uring_setup(2). Copied back with updated info on success
@@ -542,6 +553,7 @@ struct io_uring_params { · 29 unmodified lines
542553 #define IORING_FEAT_LINKED_FILE (1U << 12)
543554 #define IORING_FEAT_REG_REG_RING (1U << 13)
544555 #define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
556+#define IORING_FEAT_MIN_TIMEOUT (1U << 15)
545557
546558 /*
547559 * io_uring_register(2) opcodes and arguments
@@ -595,6 +607,11 @@ enum io_uring_register_op { · 47 unmodified lines
595607 IORING_REGISTER_NAPI = 27,
596608 IORING_UNREGISTER_NAPI = 28,
597609
610+ IORING_REGISTER_CLOCK = 29,
611+
612+ /* copy registered buffers from source ring to current ring */
613+ IORING_REGISTER_COPY_BUFFERS = 30,
614+
598615 /* this goes last */
599616 IORING_REGISTER_LAST,
600617
@@ -675,6 +692,21 @@ struct io_uring_restriction { · 74 unmodified lines
675692 __u32 resv2[3];
676693 };
677694
695+struct io_uring_clock_register {
696+ __u32 clockid;
697+ __u32 __resv[3];
698+};
699+
700+enum {
701+ IORING_REGISTER_SRC_REGISTERED = 1,
702+};
703+
704+struct io_uring_copy_buffers {
705+ __u32 src_fd;
706+ __u32 flags;
707+ __u32 pad[6];
708+};
709+
678710 struct io_uring_buf {
679711 __u64 addr;
680712 __u32 len;
@@ -707,9 +739,17 @@ struct io_uring_buf_ring { · 26 unmodified lines
707739 * mmap(2) with the offset set as:
708740 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT)
709741 * to get a virtual mapping for the ring.
742+ * IOU_PBUF_RING_INC: If set, buffers consumed from this buffer ring can be
743+ * consumed incrementally. Normally one (or more) buffers
744+ * are fully consumed. With incremental consumptions, it's
745+ * feasible to register big ranges of buffers, and each
746+ * use of it will consume only as much as it needs. This
747+ * requires that both the kernel and application keep
748+ * track of where the current read/recv index is at.
710749 */
711750 enum io_uring_register_pbuf_ring_flags {
712751 IOU_PBUF_RING_MMAP = 1,
752+ IOU_PBUF_RING_INC = 2,
713753 };
714754
715755 /* argument for IORING_(UN)REGISTER_PBUF_RING */
@@ -758,7 +798,7 @@ enum io_uring_register_restriction_op { · 42 unmodified lines
758798 struct io_uring_getevents_arg {
759799 __u64 sigmask;
760800 __u32 sigmask_sz;
761− __u32 pad;
801+ __u32 min_wait_usec;
762802 __u64 ts;
763803 };
764804