Commit c7849be
io_uring: fix __io_iopoll_check deadlock in io_sq_thread
Since commit a3a0e43 ("io_uring: don't enter poll loop if we have
CQEs pending"), if we already events pending, we won't enter poll loop.
In case SETUP_IOPOLL and SETUP_SQPOLL are both enabled, if app has
been terminated and don't reap pending events which are already in cq
ring, and there are some reqs in poll_list, io_sq_thread will enter
__io_iopoll_check(), and find pending events, then return, this loop
will never have a chance to exit.
I have seen this issue in fio stress tests, to fix this issue, let
io_sq_thread call io_iopoll_getevents() with argument 'min' being zero,
and remove __io_iopoll_check().
Fixes: a3a0e43 ("io_uring: don't enter poll loop if we have CQEs pending")
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 7143b5a commit c7849be
1 file changed
Lines changed: 9 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1672 | 1672 | | |
1673 | 1673 | | |
1674 | 1674 | | |
1675 | | - | |
1676 | | - | |
| 1675 | + | |
| 1676 | + | |
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1680 | 1686 | | |
1681 | 1687 | | |
1682 | 1688 | | |
| |||
1712 | 1718 | | |
1713 | 1719 | | |
1714 | 1720 | | |
1715 | | - | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | 1721 | | |
1731 | 1722 | | |
1732 | 1723 | | |
| |||
5118 | 5109 | | |
5119 | 5110 | | |
5120 | 5111 | | |
5121 | | - | |
| 5112 | + | |
5122 | 5113 | | |
5123 | 5114 | | |
5124 | 5115 | | |
| |||
0 commit comments