public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 0/4] cancel all reqs of an exiting task
@ 2020-06-07 15:32 Pavel Begunkov
  2020-06-07 15:32 ` [liburing PATCH] flush/test: test flush of dying process Pavel Begunkov
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Pavel Begunkov @ 2020-06-07 15:32 UTC (permalink / raw)
  To: Jens Axboe, io-uring, linux-kernel

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.

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(-)

-- 
2.24.0


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

end of thread, other threads:[~2020-06-08  7:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-07 15:32 [PATCH 0/4] cancel all reqs of an exiting task Pavel Begunkov
2020-06-07 15:32 ` [liburing PATCH] flush/test: test flush of dying process Pavel Begunkov
2020-06-07 15:32 ` [PATCH 1/4] io-wq: reorder cancellation pending -> running Pavel Begunkov
2020-06-07 15:32 ` [PATCH 2/4] io-wq: add an option to cancel all matched reqs Pavel Begunkov
2020-06-07 15:32 ` [PATCH 3/4] io_uring: cancel all task's requests on exit Pavel Begunkov
2020-06-07 15:32 ` [PATCH 4/4] io_uring: batch cancel in io_uring_cancel_files() Pavel Begunkov
2020-06-08  0:12 ` [PATCH 0/4] cancel all reqs of an exiting task Jens Axboe
2020-06-08  7:35   ` Pavel Begunkov

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