Skip to content

Reliable cancelation or wait for completion of specified sqe #608

Answered by axboe
CarterLi asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, I think that's possible and I've been thinking about a way to do it that is basically free. Here's the idea:

  1. For returns that would do 0 or -ENOENT, these are already sync. Doing that off IORING_REGISTER_CANCEL would work the exact same way and no changes are needed.
  2. For -EALREADY, if we get that return, then we need to add ourselves to the completion wait queue. That one is woken every time a completion posts, if it's active. Then it's simply the case of retrying the cancelation every time we get woken until we get -ENOENT. Once we do, the request is no longer active and we can return.

With that approach, we have all the bits needed for a sync cancelation API through io_uring_regi…

Replies: 6 comments 19 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@axboe
Comment options

@CarterLi
Comment options

Comment options

You must be logged in to vote
1 reply
@CarterLi
Comment options

Comment options

You must be logged in to vote
15 replies
@CarterLi
Comment options

@axboe
Comment options

@CarterLi
Comment options

@CarterLi
Comment options

@axboe
Comment options

Answer selected by CarterLi
Comment options

You must be logged in to vote
1 reply
@axboe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants