io_uring: don't take task ring-file notes
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 6 Mar 2021 11:02:14 +0000 (11:02 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 7 Mar 2021 21:12:43 +0000 (14:12 -0700)
commiteebd2e37e662617a6b8041db75205f0a262ce870
tree6dc00160308de3a867a0f7771c0c83270f177ae9
parentd56d938b4bef3e1421a42023cdcd6e13c1f50831
io_uring: don't take task ring-file notes

With ->flush() gone we're now leaving all uring file notes until the
task dies/execs, so the ctx will not be freed until all tasks that have
ever submit a request die. It was nicer with flush but not much, we
could have locked as described ctx in many cases.

Now we guarantee that ctx outlives all tctx in a sense that
io_ring_exit_work() waits for all tctxs to drop their corresponding
enties in ->xa, and ctx won't go away until then. Hence, additional
io_uring file reference (a.k.a. task file notes) are not needed anymore.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c