]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: clean up tctx_task_work()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 10 Aug 2021 16:53:55 +0000 (17:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:32 +0000 (13:10 -0600)
commit18f2249063e5ce3363af2e8e5766c616f134c59c
tree6b9db8e8d47c9179dc064e5c7301a9e542b9c521
parenta7ee26893bddac8ee492794c3e1a643e90bc0fbd
io_uring: clean up tctx_task_work()

After recent fixes, tctx_task_work() always does proper spinlocking
before looking into ->task_list, so now we don't need atomics for
->task_state, replace it with non-atomic task_running using the critical
section.

Tide it up, combine two separate block with spinlocking, and always try
to splice in there, so we do less locking when new requests are arriving
during the function execution.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: fix missing ->task_running reset on task_work_add() failure]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c