History

io_uring: add IORING_SETUP_TASKRUN_FLAG

If IORING_SETUP_COOP_TASKRUN is set to use cooperative scheduling for running task_work, then IORING_SETUP_TASKRUN_FLAG can be set so the application can tell if task_work is pending in the kernel for this ring. This allows use cases like io_uring_peek_cqe() to still function appropriately, or for the task to know when it would be useful to call io_uring_wait_cqe() to run pending events.

Jens Axboe committed 4 years ago

Commit ef060ea1 parent e1169f02 files · +18 −3Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+7−0
@@ -110,6 +110,12 @@ enum { · 109 unmodified lines
110110 * a task running in userspace, and saves an IPI.
111111 */
112112 #define IORING_SETUP_COOP_TASKRUN (1U << 8)
113+/*
114+ * If COOP_TASKRUN is set, get notified if task work is available for
115+ * running and a kernel transition would be needed to run it. This sets
116+ * IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
117+ */
118+#define IORING_SETUP_TASKRUN_FLAG (1U << 9)
113119
114120 enum {
115121 IORING_OP_NOP,
@@ -256,6 +262,7 @@ struct io_sqring_offsets { · 140 unmodified lines
256262 */
257263 #define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */
258264 #define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */
265+#define IORING_SQ_TASKRUN (1U << 2) /* task should enter the kernel */
259266
260267 struct io_cqring_offsets {
261268 __u32 head;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t