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>
Tue, 10 Aug 2021 19:53:26 +0000 (13:53 -0600)
commitf2100e4223209ea53db1bf13c563ac2873109442
tree007b97c447da0d49a3d232a3e0d164602616c175
parent99eed2aeae18e0bfdcf9f4d1dd7f7f869c44df2a
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c