summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-10-12 14:12:20 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-18 15:17:36 +0300
commitd729cf9acb9311956c8a37113dcfa0160a2d9665 (patch)
treedb98a1f9ce4a4ddf9e454bc8660a87dacb616061 /block
parentef99b2d37666b7a600baab9e1c4944436652b0a2 (diff)
downloadlinux-d729cf9acb9311956c8a37113dcfa0160a2d9665.tar.xz
io_uring: don't sleep when polling for I/O
There is no point in sleeping for the expected I/O completion timeout in the io_uring async polling model as we never poll for a specific I/O. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Mark Wunderlich <mark.wunderlich@intel.com> Link: https://lore.kernel.org/r/20211012111226.760968-11-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 6609e10657a8..97c24e461d0a 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4103,7 +4103,8 @@ int blk_poll(struct request_queue *q, blk_qc_t cookie, unsigned int flags)
if (current->plug)
blk_flush_plug_list(current->plug, false);
- if (q->poll_nsec != BLK_MQ_POLL_CLASSIC) {
+ if (!(flags & BLK_POLL_NOSLEEP) &&
+ q->poll_nsec != BLK_MQ_POLL_CLASSIC) {
if (blk_mq_poll_hybrid(q, cookie))
return 1;
}