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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux