io_uring: set ctx need-wakeup flag when SQPOLL thread is going idle
authorJens Axboe <axboe@kernel.dk>
Mon, 7 Sep 2020 16:18:37 +0000 (10:18 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Sep 2020 14:13:31 +0000 (08:13 -0600)
commitdf033a30aaee1e37ddc46bd471dc28b1f196d3ce
tree64e81f0952501426a93f763f933d891ddec839e4
parent9702185561a541735610e9d54ad3fcea5a192a14
io_uring: set ctx need-wakeup flag when SQPOLL thread is going idle

Don't set the ctx SQPOLL need-wakeup flag before we're going idle for all
rings in this shared mapping. We could have some rings that are idle, but
also still have ones that are either spinning or processing work. This
can cause extraneous system calls for the rings that are idle, while the
thread is still doing work.

Fixes: eeb9711daf2c ("io_uring: enable IORING_SETUP_ATTACH_WQ to attach to SQPOLL thread too")
Reported-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c