Message ID | cb5e5c3bb9ac13ca7e1026ceb484c03c0367e14b.1605788995.git.asml.silence@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | blk-mq: skip hybrid polling if iopoll doesn't spin | expand |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 55bcee5dc032..d72166c46a4f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3865,7 +3865,7 @@ int blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin) * the IO isn't complete, we'll get called again and will go * straight to the busy poll loop. */ - if (blk_mq_poll_hybrid(q, hctx, cookie)) + if (!spin && blk_mq_poll_hybrid(q, hctx, cookie)) return 1; hctx->poll_considered++;
io_uring might be iterating over several devices/files iopoll'ing each of them, for that it passes spin=false expecting quick return if there are no requests to complete. However, blk_poll() will sleep if hybrid poll is enabled. Skip sleeping there if specified not to spin. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)