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 23:51:42 +0000 (17:51 -0600)
commit825763bae1b80b68b989f33c007000dc9598f6ea
treef55398f3c55f5f1b30038946c3eb1d7d7762ad30
parent3b8fa628e7e55a855871a4e43666fd5f4f710d9d
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