io-uring-cancellation · shipping · also io_uring cancelation, IORING_OP_ASYNC_CANCEL

io_uring cancellation

io_uring cancellation is a request to stop matching outstanding operations, with a result separate from each target operation's completion.

Related Observatory article: Read on hesela.com

For a single user_data match with flags zero, the cancellation CQE reports 0 on success, -ENOENT when no target is found, or -EALREADY when immediate cancellation is no longer possible. A completed target and an incorrect identifier can both explain -ENOENT; inspect the target CQE. [1]

Use distinct target and cancellation identifiers; do not recycle the target identifier until its completion and all cancellation attempts targeting it are accounted for. [3] In Linux v6.14, a bulk counter can include running-work results, so it is not a completed-request ledger. [2]

Read/write payload buffers must remain valid until the target operation completes; submission stability does not shorten that lifetime. [5]

Relations

related
io_uring, io_uring completion queue entry, io_uring linked timeout, I/O timeout, io_uring linked requests, POSIX AIO cancellation

Advantages

  • Makes cancellation an explicit operation whose result can be correlated with its target.

Limitations

  • Cancellation is not rollback or persistence confirmation.
  • The single-target result convention does not describe bulk cancellation counts.

Citations

  1. liburing 2.9: io_uring_prep_cancel(3), single-target results and completion handling. (accessed 2026-10-17)
  2. Linux v6.14: io_async_cancel_one and __io_async_cancel, including the bulk-count path. (accessed 2026-10-17)
  3. liburing 2.9: io_uring_cqe_get_data(3), application-supplied completion identity. (accessed 2026-10-17)
  4. liburing: io_uring(7), SQE pointer lifetimes and data stability; current manual reviewed 17 October 2026. (accessed 2026-10-17)

Further reading

  1. io_uring: completion is not a durable commit (accessed 2026-10-17)

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

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. io_uring cancellation. Hesela. 2026-11-13. https://hesela.dev/terms/io-uring-cancellation/