History

Merge tag 'for-6.4/io_uring-2023-04-21' of git://git.kernel.dk/linux

Pull io_uring updates from Jens Axboe: - Cleanup of the io-wq per-node mapping, notably getting rid of it so we just have a single io_wq entry per ring (Breno) - Followup to the above, move accounting to io_wq as well and completely drop struct io_wqe (Gabriel) - Enable KASAN for the internal io_uring caches (Breno) - Add support for multishot timeouts. Some applications use timeouts to wake someone waiting on completion entries, and this makes it a bit easier to just have a recurring timer rather than needing to rearm it every time (David) - Support archs that have shared cache coloring between userspace and the kernel, and hence have strict address requirements for mmap'ing the ring into userspace. This should only be parisc/hppa. (Helge, me) - XFS has supported O_DIRECT writes without needing to lock the inode exclusively for a long time, and ext4 now supports it as well. This is true for the common cases of not extending the file size. Flag the fs as having that feature, and utilize that to avoid serializing those writes in io_uring (me) - Enable completion batching for uring commands (me) - Revert patch adding io_uring restriction to what can be GUP mapped or not. This does not belong in io_uring, as io_uring isn't really special in this regard. Since this is also getting in the way of cleanups and improvements to the GUP code, get rid of if (me) - A few series greatly reducing the complexity of registered resources, like buffers or files. Not only does this clean up the code a lot, the simplified code is also a LOT more efficient (Pavel) - Series optimizing how we wait for events and run task_work related to it (Pavel) - Fixes for file/buffer unregistration with DEFER_TASKRUN (Pavel) - Misc cleanups and improvements (Pavel, me) * tag 'for-6.4/io_uring-2023-04-21' of git://git.kernel.dk/linux: (71 commits) Revert "io_uring/rsrc: disallow multi-source reg buffers" io_uring: add support for multishot timeouts io_uring/rsrc: disassociate nodes and rsrc_data io_uring/rsrc: devirtualise rsrc put callbacks io_uring/rsrc: pass node to io_rsrc_put_work() io_uring/rsrc: inline io_rsrc_put_work() io_uring/rsrc: add empty flag in rsrc_node io_uring/rsrc: merge nodes and io_rsrc_put io_uring/rsrc: infer node from ctx on io_queue_rsrc_removal io_uring/rsrc: remove unused io_rsrc_node::llist io_uring/rsrc: refactor io_queue_rsrc_removal io_uring/rsrc: simplify single file node switching io_uring/rsrc: clean up __io_sqe_buffers_update() io_uring/rsrc: inline switch_start fast path io_uring/rsrc: remove rsrc_data refs io_uring/rsrc: fix DEFER_TASKRUN rsrc quiesce io_uring/rsrc: use wq for quiescing io_uring/rsrc: refactor io_rsrc_ref_quiesce io_uring/rsrc: remove io_rsrc_node::done io_uring/rsrc: use nospec'ed indexes ...

Linus Torvalds committed 3 years ago

Commit 5b9a7bb2 parents 5c7ecad 3c85cc422 files · +949 −847Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+19−14
@@ -250,6 +250,7 @@ enum io_uring_op { · 249 unmodified lines
250#define IORING_TIMEOUT_REALTIME (1U << 3)250#define IORING_TIMEOUT_REALTIME (1U << 3)
251#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)251#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
252#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)252#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
253#define IORING_TIMEOUT_MULTISHOT (1U << 6)
253#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)254#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
254#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)255#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
255/*256/*
@@ -389,6 +390,9 @@ enum { · 133 unmodified lines
389#define IORING_OFF_SQ_RING 0ULL390#define IORING_OFF_SQ_RING 0ULL
390#define IORING_OFF_CQ_RING 0x8000000ULL391#define IORING_OFF_CQ_RING 0x8000000ULL
391#define IORING_OFF_SQES 0x10000000ULL392#define IORING_OFF_SQES 0x10000000ULL
393#define IORING_OFF_PBUF_RING 0x80000000ULL
394#define IORING_OFF_PBUF_SHIFT 16
395#define IORING_OFF_MMAP_MASK 0xf8000000ULL
392 396
393/*397/*
394 * Filled with the offset for mmap(2)398 * Filled with the offset for mmap(2)
@@ -568,19 +572,6 @@ struct io_uring_rsrc_update2 { · 173 unmodified lines
568 __u32 resv2;572 __u32 resv2;
569};573};
570 574
571struct io_uring_notification_slot {
572 __u64 tag;
573 __u64 resv[3];
574};
575
576struct io_uring_notification_register {
577 __u32 nr_slots;
578 __u32 resv;
579 __u64 resv2;
580 __u64 data;
581 __u64 resv3;
582};
583
584/* Skip updating fd indexes set to this value in the fd table */575/* Skip updating fd indexes set to this value in the fd table */
585#define IORING_REGISTER_FILES_SKIP (-2)576#define IORING_REGISTER_FILES_SKIP (-2)
586 577
@@ -635,12 +626,26 @@ struct io_uring_buf_ring { · 48 unmodified lines
635 };626 };
636};627};
637 628
629/*
630 * Flags for IORING_REGISTER_PBUF_RING.
631 *
632 * IOU_PBUF_RING_MMAP: If set, kernel will allocate the memory for the ring.
633 * The application must not set a ring_addr in struct
634 * io_uring_buf_reg, instead it must subsequently call
635 * mmap(2) with the offset set as:
636 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT)
637 * to get a virtual mapping for the ring.
638 */
639enum {
640 IOU_PBUF_RING_MMAP = 1,
641};
642
638/* argument for IORING_(UN)REGISTER_PBUF_RING */643/* argument for IORING_(UN)REGISTER_PBUF_RING */
639struct io_uring_buf_reg {644struct io_uring_buf_reg {
640 __u64 ring_addr;645 __u64 ring_addr;
641 __u32 ring_entries;646 __u32 ring_entries;
642 __u16 bgid;647 __u16 bgid;
643 __u16 pad;648 __u16 flags;
644 __u64 resv[3];649 __u64 resv[3];
645};650};
646 651