History

io_uring: add support for marking commands as draining

There are no ordering constraints between the submission and completion side of io_uring. But sometimes that would be useful to have. One common example is doing an fsync, for instance, and have it ordered with previous writes. Without support for that, the application must do this tracking itself. This adds a general SQE flag, IOSQE_IO_DRAIN. If a command is marked with this flag, then it will not be issued before previous commands have completed, and subsequent commands submitted after the drain will not be issued before the drain is started.. If there are no pending commands, setting this flag will not change the behavior of the issue of the command.

Jens Axboe committed 7 years ago

Commit de0617e1 parent ea986672 files · +89 −3Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+1−0
@@ -38,6 +38,7 @@ struct io_uring_sqe { · 37 unmodified lines
3838 * sqe->flags
3939 */
4040 #define IOSQE_FIXED_FILE (1U << 0) /* use fixed fileset */
41+#define IOSQE_IO_DRAIN (1U << 1) /* issue after inflight IO */
4142
4243 /*
4344 * io_uring_setup() flags