Commit c8d317a
io_uring: fix async buffered reads when readahead is disabled
The async buffered reads feature is not working when readahead is
turned off. There are two things to concern:
- when doing retry in io_read, not only the IOCB_WAITQ flag but also
the IOCB_NOWAIT flag is still set, which makes it goes to would_block
phase in generic_file_buffered_read() and then return -EAGAIN. After
that, the io-wq thread work is queued, and later doing the async
reads in the old way.
- even if we remove IOCB_NOWAIT when doing retry, the feature is still
not running properly, since in generic_file_buffered_read() it goes to
lock_page_killable() after calling mapping->a_ops->readpage() to do
IO, and thus causing process to sleep.
Fixes: 1a0a785 ("mm: support async buffered reads in generic_file_buffered_read()")
Fixes: 3b2a443 ("io_uring: get rid of kiocb_wait_page_queue_init()")
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent fad8e0d commit c8d317a
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3049 | 3049 | | |
3050 | 3050 | | |
3051 | 3051 | | |
| 3052 | + | |
3052 | 3053 | | |
3053 | 3054 | | |
3054 | 3055 | | |
| |||
3106 | 3107 | | |
3107 | 3108 | | |
3108 | 3109 | | |
| 3110 | + | |
3109 | 3111 | | |
3110 | 3112 | | |
3111 | 3113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2267 | 2267 | | |
2268 | 2268 | | |
2269 | 2269 | | |
2270 | | - | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
2271 | 2275 | | |
2272 | 2276 | | |
2273 | 2277 | | |
| |||
0 commit comments