]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: lazy get task
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 15 Jun 2020 07:33:13 +0000 (10:33 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Jun 2020 14:51:35 +0000 (08:51 -0600)
commit3edbbcd095a07f318e5b3ee9d907950cfbc7696c
tree679decb480c4e352ae5387ce87d0ffdd2395db88
parent819a32be0f03cbeba0c8042e896c8b8accee8252
io_uring: lazy get task

There will be multiple places where req->task is used, so refcount-pin
it lazily with introduced *io_{get,put}_req_task(). We need to always
have valid ->task for cancellation reasons, but don't care about pinning
it in some cases. That's why it sets req->task in io_req_init() and
implements get/put laziness with a flag.

This also removes using @current from polling io_arm_poll_handler(),
etc., but doesn't change observable behaviour.

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