io_uring/io-wq: return 2-step work swap scheme
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 10 Mar 2021 11:30:44 +0000 (11:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 13:19:16 +0000 (14:19 +0100)
commit597d08666ac76cd5d82e227985b1fc723c14e4a2
tree72699bdf72a3c4771e107d4f46e6ebed83d1fd76
parent811c86bcc67eecfed970a293e13e9a57398e832d
io_uring/io-wq: return 2-step work swap scheme

commit 5280f7e530f71ba85baf90169393196976ad0e52 upstream

Saving one lock/unlock for io-wq is not super important, but adds some
ugliness in the code. More important, atomic decs not turning it to zero
for some archs won't give the right ordering/barriers so the
io_steal_work() may pretty easily get subtly and completely broken.

Return back 2-step io-wq work exchange and clean it up.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c