diff mbox series

[v2] blk-mq: skip hybrid polling if iopoll doesn't spin

Message ID 972a4d02be5d52d98e8e5523ff4440d30a9cf00a.1605789192.git.asml.silence@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] blk-mq: skip hybrid polling if iopoll doesn't spin | expand

Commit Message

Pavel Begunkov Nov. 19, 2020, 12:35 p.m. UTC
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>
---

v2: inverse invalid spin check

 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 55bcee5dc032..38262212fc99 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++;