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: io_uring cancellation 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-cqe, io-uring-linked-timeout, io-timeout

Advantages

Limitations

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