public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCHSET next 0/4] Allow cancelation based on fd
@ 2022-04-14 20:24 Jens Axboe
  2022-04-14 20:24 ` [PATCH 1/4] io_uring: remove dead 'poll_only' argument to io_poll_cancel() Jens Axboe
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jens Axboe @ 2022-04-14 20:24 UTC (permalink / raw)
  To: io-uring

Hi,

We currently only support looking up and canceling requests based on
the user_data of the original request. Sometimes it can be useful to
instead key off the fd used in the original request, eg if a socket
goes away.

Patch 1 is just a cleanup spotted while doing this, 2+3 are prep patches,
and patch 4 then finally is the meat of it.

Adds IORING_ASYNC_CANCEL_FD as a IORING_OP_ASYNC_CANCEL request flag,
which tells the kernel that we're looking up by fd rather than user_data.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCHSET v3 next 0/4] Extend cancelation support
@ 2022-04-16  0:25 Jens Axboe
  2022-04-16  0:25 ` [PATCH 1/4] io_uring: remove dead 'poll_only' argument to io_poll_cancel() Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2022-04-16  0:25 UTC (permalink / raw)
  To: io-uring

Hi,

We currently only support looking up and canceling requests based on
the user_data of the original request. Sometimes it can be useful to
instead key off the fd used in the original request, eg if a socket
goes away.

Patch 1 is just a cleanup spotted while doing this, 2 is a prep patch,
patch 3 adds support for IORING_ASYNC_CANCEL_ALL, and finally patch 4
adds support for IORING_ASYNC_CANCEL_FD.

If IORING_ASYNC_CANCEL_ALL is set, all requests matching the given
criteria are canceled. Return value is number of requests canceled,
and 0 if none were found, or any error encountered canceling requests.

If IORING_ASYNC_CANCEL_FD is set, requests matching sqe->fd are
canceled rather than matching on sqe->addr for user_data.

v3:
- Fixup issues with CANCEL_ALL
- Combine two prep patches, and extent io_cancel_data propagation
  further.
- Get rid of buggy task_work running, we don't need it anymore.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-16  0:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-14 20:24 [PATCHSET next 0/4] Allow cancelation based on fd Jens Axboe
2022-04-14 20:24 ` [PATCH 1/4] io_uring: remove dead 'poll_only' argument to io_poll_cancel() Jens Axboe
2022-04-14 20:24 ` [PATCH 2/4] io_uring: pass in struct io_cancel_data consistently Jens Axboe
2022-04-14 20:24 ` [PATCH 3/4] io_uring: rename io_cancel_data->user_data to just 'data' Jens Axboe
2022-04-14 20:24 ` [PATCH 4/4] io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2022-04-16  0:25 [PATCHSET v3 next 0/4] Extend cancelation support Jens Axboe
2022-04-16  0:25 ` [PATCH 1/4] io_uring: remove dead 'poll_only' argument to io_poll_cancel() Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox