public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] blk-mq: skip hybrid polling if iopoll doesn't spin
@ 2020-11-19 12:30 Pavel Begunkov
  2020-11-19 12:35 ` [PATCH v2] " Pavel Begunkov
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2020-11-19 12:30 UTC (permalink / raw)
  To: Jens Axboe, linux-block, io-uring

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 <[email protected]>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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++;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] blk-mq: skip hybrid polling if iopoll doesn't spin
  2020-11-19 12:30 [PATCH] blk-mq: skip hybrid polling if iopoll doesn't spin Pavel Begunkov
@ 2020-11-19 12:35 ` Pavel Begunkov
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Begunkov @ 2020-11-19 12:35 UTC (permalink / raw)
  To: Jens Axboe, linux-block, io-uring

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 <[email protected]>
---

v2: inverse invalid spin check

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

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++;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-19 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-19 12:30 [PATCH] blk-mq: skip hybrid polling if iopoll doesn't spin Pavel Begunkov
2020-11-19 12:35 ` [PATCH v2] " Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox