io-uring-drain · shipping · also IOSQE_IO_DRAIN

io_uring drain

io_uring drain is a submission flag that delays a request until earlier requests in the same ring finish and delays later requests until the drain request finishes.

Related Observatory article: Read on hesela.com

Drain orders completion within one ring; it is not a device-cache flush. [1] The documented API forbids mixing IO_DRAIN with IOSQE_CQE_SKIP_SUCCESS in one ring, including on separate requests. [2]

IOSQE_IO_DRAIN is bit 1 of the submission flags, value 2, and has been available since Linux 5.2. A drained request does not start before all previously submitted requests have completed, and later requests do not start before it completes. [2] [4]

A link chain orders only the requests joined to it, while a drain waits for every earlier request in the ring. One slow earlier request therefore also delays all requests submitted after the drain. [2]

Relations

related
io_uring, io_uring linked requests, fsync, Persistence ordering

Advantages

  • Can establish a ring-scoped dependency before a synchronization request. [1]

Limitations

  • It does not order another ring or validate earlier write results.

Citations

  1. liburing 2.9: io_uring_sqe_set_flags(3), chain and drain scope. (accessed 2026-10-14)
  2. liburing: io_uring_enter(2), IORING_OP_FSYNC, linking and CQE_SKIP_SUCCESS constraints. (accessed 2026-10-22)
  3. Linux v6.16 include/uapi/linux/io_uring.h: submission flag bits (accessed 2026-10-22)

Further reading

  1. io_uring: completion is not a durable commit (accessed 2026-10-14)
Sources & caveats
  • flags is the liburing 2.9 io_uring_sqe_set_flags(3) page, kept from the earlier version.
  • enter is the Linux man-pages io_uring_enter(2) page, reread on the access date in IOSQE_IO_DRAIN, IOSQE_IO_LINK and IOSQE_CQE_SKIP_SUCCESS.
  • uapi-header is include/uapi/linux/io_uring.h at tag v6.16, read in enum io_uring_sqe_flags_bit.
  • Bit 1 and value 2 come from uapi-header. 5.2 comes from enter.

JSON: /data/terms/io-uring-drain.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. io_uring drain. Hesela. 2026-10-22. https://hesela.dev/terms/io-uring-drain/