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.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -102,6 +102,14 @@ enum { · 101 unmodified lines | ||
| 102 | 102 | #define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */ |
| 103 | 103 | #define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */ |
| 104 | 104 | #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) | |
| 105 | 113 | |
| 106 | 114 | enum { |
| 107 | 115 | IORING_OP_NOP, |