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 ...
Showing the changes to include/uapi/linux (1 of 20 files). Show all
Unified · Split
| @@ -440,11 +440,21 @@ struct io_uring_cqe { · 439 unmodified lines | |||
| 440 | * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv | 440 | * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv |
| 441 | * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct | 441 | * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct |
| 442 | * them from sends. | 442 | * 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. | ||
| 443 | */ | 452 | */ |
| 444 | #define IORING_CQE_F_BUFFER (1U << 0) | 453 | #define IORING_CQE_F_BUFFER (1U << 0) |
| 445 | #define IORING_CQE_F_MORE (1U << 1) | 454 | #define IORING_CQE_F_MORE (1U << 1) |
| 446 | #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) | 455 | #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) |
| 447 | #define IORING_CQE_F_NOTIF (1U << 3) | 456 | #define IORING_CQE_F_NOTIF (1U << 3) |
| 457 | #define IORING_CQE_F_BUF_MORE (1U << 4) | ||
| 448 | 458 | ||
| 449 | #define IORING_CQE_BUFFER_SHIFT 16 | 459 | #define IORING_CQE_BUFFER_SHIFT 16 |
| 450 | 460 | ||
| @@ -507,6 +517,7 @@ struct io_cqring_offsets { · 56 unmodified lines | |||
| 507 | #define IORING_ENTER_SQ_WAIT (1U << 2) | 517 | #define IORING_ENTER_SQ_WAIT (1U << 2) |
| 508 | #define IORING_ENTER_EXT_ARG (1U << 3) | 518 | #define IORING_ENTER_EXT_ARG (1U << 3) |
| 509 | #define IORING_ENTER_REGISTERED_RING (1U << 4) | 519 | #define IORING_ENTER_REGISTERED_RING (1U << 4) |
| 520 | #define IORING_ENTER_ABS_TIMER (1U << 5) | ||
| 510 | 521 | ||
| 511 | /* | 522 | /* |
| 512 | * Passed in for io_uring_setup(2). Copied back with updated info on success | 523 | * 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 | |||
| 542 | #define IORING_FEAT_LINKED_FILE (1U << 12) | 553 | #define IORING_FEAT_LINKED_FILE (1U << 12) |
| 543 | #define IORING_FEAT_REG_REG_RING (1U << 13) | 554 | #define IORING_FEAT_REG_REG_RING (1U << 13) |
| 544 | #define IORING_FEAT_RECVSEND_BUNDLE (1U << 14) | 555 | #define IORING_FEAT_RECVSEND_BUNDLE (1U << 14) |
| 556 | #define IORING_FEAT_MIN_TIMEOUT (1U << 15) | ||
| 545 | 557 | ||
| 546 | /* | 558 | /* |
| 547 | * io_uring_register(2) opcodes and arguments | 559 | * io_uring_register(2) opcodes and arguments |
| @@ -595,6 +607,11 @@ enum io_uring_register_op { · 47 unmodified lines | |||
| 595 | IORING_REGISTER_NAPI = 27, | 607 | IORING_REGISTER_NAPI = 27, |
| 596 | IORING_UNREGISTER_NAPI = 28, | 608 | IORING_UNREGISTER_NAPI = 28, |
| 597 | 609 | ||
| 610 | IORING_REGISTER_CLOCK = 29, | ||
| 611 | |||
| 612 | /* copy registered buffers from source ring to current ring */ | ||
| 613 | IORING_REGISTER_COPY_BUFFERS = 30, | ||
| 614 | |||
| 598 | /* this goes last */ | 615 | /* this goes last */ |
| 599 | IORING_REGISTER_LAST, | 616 | IORING_REGISTER_LAST, |
| 600 | 617 | ||
| @@ -675,6 +692,21 @@ struct io_uring_restriction { · 74 unmodified lines | |||
| 675 | __u32 resv2[3]; | 692 | __u32 resv2[3]; |
| 676 | }; | 693 | }; |
| 677 | 694 | ||
| 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 | |||
| 678 | struct io_uring_buf { | 710 | struct io_uring_buf { |
| 679 | __u64 addr; | 711 | __u64 addr; |
| 680 | __u32 len; | 712 | __u32 len; |
| @@ -707,9 +739,17 @@ struct io_uring_buf_ring { · 26 unmodified lines | |||
| 707 | * mmap(2) with the offset set as: | 739 | * mmap(2) with the offset set as: |
| 708 | * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT) | 740 | * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT) |
| 709 | * to get a virtual mapping for the ring. | 741 | * 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. | ||
| 710 | */ | 749 | */ |
| 711 | enum io_uring_register_pbuf_ring_flags { | 750 | enum io_uring_register_pbuf_ring_flags { |
| 712 | IOU_PBUF_RING_MMAP = 1, | 751 | IOU_PBUF_RING_MMAP = 1, |
| 752 | IOU_PBUF_RING_INC = 2, | ||
| 713 | }; | 753 | }; |
| 714 | 754 | ||
| 715 | /* argument for IORING_(UN)REGISTER_PBUF_RING */ | 755 | /* argument for IORING_(UN)REGISTER_PBUF_RING */ |
| @@ -758,7 +798,7 @@ enum io_uring_register_restriction_op { · 42 unmodified lines | |||
| 758 | struct io_uring_getevents_arg { | 798 | struct io_uring_getevents_arg { |
| 759 | __u64 sigmask; | 799 | __u64 sigmask; |
| 760 | __u32 sigmask_sz; | 800 | __u32 sigmask_sz; |
| 761 | __u32 pad; | 801 | __u32 min_wait_usec; |
| 762 | __u64 ts; | 802 | __u64 ts; |
| 763 | }; | 803 | }; |
| 764 | 804 | ||