]> git.baikalelectronics.ru Git - kernel.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)
commite6fcaff907031b5560f6bfd9e9811f25ece70ef2
tree3f45081913cc810132a9b2596a0af98b87d957a3
parent689a4bafbde387a29b2b53542c06d2e38939fdb3
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