Skip to content

cancel all reqs of an exiting task

Pavel Begunkov io-uring lkml 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyApplied
  2. v14 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4io-wq: reorder cancellation pending -> runningfs/io-wq.c+32 -220 replies
2/4io-wq: add an option to cancel all matched reqsfs/io-wq.c fs/io-wq.h fs/io_uring.c+36 -280 replies
3/4io_uring: cancel all task's requests on exitfs/io-wq.c fs/io-wq.h fs/io_uring.c+12 -170 replies
4/4io_uring: batch cancel in io_uring_cancel_files()fs/io_uring.c+13 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4][RESEND] cancel all reqs of an exiting task
io_uring_flush() {
        ...
        if (fatal_signal_pending(current) || (current->flags & PF_EXITING))
                io_wq_cancel_pid(ctx->io_wq, task_pid_vnr(current));
}

This cancels only the first matched request. The pathset is mainly about fixing that. [1,2] are preps, [3/4] is the fix.

The [4/4] tries to improve the worst case for io_uring_cancel_files(), that's when they are a lot of inflights with ->files. Instead of doing {kill(); wait();} one by one, it cancels all of them at once.

v2: rebase

Pavel Begunkov (4):
io-wq: reorder cancellation pending -> running
io-wq: add an option to cancel all matched reqs
io_uring: cancel all task's requests on exit
io_uring: batch cancel in io_uring_cancel_files()

 fs/io-wq.c    | 108 ++++++++++++++++++++++++++------------------------
 fs/io-wq.h    |   3 +-
 fs/io_uring.c |  29 ++++++++++++--
 3 files changed, 83 insertions(+), 57 deletions(-)
Signature · 1 line
2.24.0