]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix race condition when sq threads goes sleeping
authorStefan Bühler <source@stbuehler.de>
Fri, 19 Apr 2019 09:57:45 +0000 (11:57 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Apr 2019 17:00:56 +0000 (11:00 -0600)
commitd3b750fa4f4cf84e7b5ebe740db0c520b561edbf
tree9c6bd0dd0456a51080c7ed95350768452385aecb
parent7e85ef8b924017e6fd0e51c7060c0f4d0e3c60bd
io_uring: fix race condition when sq threads goes sleeping

Reading the SQ tail needs to come after setting IORING_SQ_NEED_WAKEUP in
flags; there is no cheap barrier for ordering a store before a load, a
full memory barrier is required.

Userspace needs a full memory barrier between updating SQ tail and
checking for the IORING_SQ_NEED_WAKEUP too.

Signed-off-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c