Commit 7143b5a
io_uring: prevent sq_thread from spinning when it should stop
This patch drops 'cur_mm' before calling cond_resched(), to prevent
the sq_thread from spinning even when the user process is finished.
Before this patch, if the user process ended without closing the
io_uring fd, the sq_thread continues to spin until the
'sq_thread_idle' timeout ends.
In the worst case where the 'sq_thread_idle' parameter is bigger than
INT_MAX, the sq_thread will spin forever.
Fixes: 6c271ce ("io_uring: add submission polling")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 929a3af commit 7143b5a
1 file changed
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5142 | 5142 | | |
5143 | 5143 | | |
5144 | 5144 | | |
| 5145 | + | |
| 5146 | + | |
| 5147 | + | |
| 5148 | + | |
| 5149 | + | |
| 5150 | + | |
| 5151 | + | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
5145 | 5157 | | |
5146 | 5158 | | |
5147 | 5159 | | |
| |||
5156 | 5168 | | |
5157 | 5169 | | |
5158 | 5170 | | |
5159 | | - | |
5160 | | - | |
5161 | | - | |
5162 | | - | |
5163 | | - | |
5164 | | - | |
5165 | | - | |
5166 | | - | |
5167 | | - | |
5168 | | - | |
5169 | | - | |
5170 | | - | |
5171 | 5171 | | |
5172 | 5172 | | |
5173 | 5173 | | |
| |||
0 commit comments