History

io_uring: use TWA_SIGNAL_NO_IPI if IORING_SETUP_COOP_TASKRUN is used

If this is set, io_uring will never use an IPI to deliver a task_work notification. This can be used in the common case where a single task or thread communicates with the ring, and doesn't rely on io_uring_cqe_peek(). This provides a noticeable win in performance, both from eliminating the IPI itself, but also from avoiding interrupting the submitting task unnecessarily.

Jens Axboe committed 4 years ago

Commit e1169f01 parent 9f010502 files · +21 −4Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+8−0
@@ -102,6 +102,14 @@ enum { · 101 unmodified lines
102102 #define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
103103 #define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */
104104 #define IORING_SETUP_SUBMIT_ALL (1U << 7) /* continue submit on error */
105+/*
106+ * Cooperative task running. When requests complete, they often require
107+ * forcing the submitter to transition to the kernel to complete. If this
108+ * flag is set, work will be done when the task transitions anyway, rather
109+ * than force an inter-processor interrupt reschedule. This avoids interrupting
110+ * a task running in userspace, and saves an IPI.
111+ */
112+#define IORING_SETUP_COOP_TASKRUN (1U << 8)
105113
106114 enum {
107115 IORING_OP_NOP,