]> www.infradead.org Git - linux-platform-drivers-x86.git/commit
io_uring: check sqring and iopoll_list before shedule
authorHao Xu <haoxu@linux.alibaba.com>
Wed, 21 Apr 2021 15:19:11 +0000 (23:19 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 Apr 2021 14:26:41 +0000 (08:26 -0600)
commit724cb4f9ec905173f32c5bd08fec26abaecc6a1d
tree3f45081913cc810132a9b2596a0af98b87d957a3
parentf2a48dd09b8e933f59570692e1382b81d4fddc49
io_uring: check sqring and iopoll_list before shedule

do this to avoid race below:

         userspace                         kernel

                               |  check sqring and iopoll_list
submit sqe                     |
check IORING_SQ_NEED_WAKEUP    |
(which is not set)    |        |
                               |  set IORING_SQ_NEED_WAKEUP
wait cqe                       |  schedule(never wakeup again)

Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/1619018351-75883-1-git-send-email-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c