io_uring: add IORING_SETUP_TASKRUN_FLAG
authorJens Axboe <axboe@kernel.dk>
Tue, 26 Apr 2022 01:49:04 +0000 (19:49 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Apr 2022 14:39:39 +0000 (08:39 -0600)
commit6f07a54a90ee98ae13b37ac358624d7cc7e57850
tree5473514f7199fd654c7cf33bb5984a82e0daf48d
parenta933a9031e40c972c24ce6406e7cea73657728a5
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.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20220426014904.60384-7-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h