Thread (4 messages) 4 messages, 3 authors, 2020-09-28

Re: [PATCH] [v3] blk-mq: add cond_resched() in __blk_mq_alloc_rq_maps()

From: Bart Van Assche <bvanassche@acm.org>
Date: 2020-09-26 04:07:28
Also in: lkml

On 2020-09-25 19:39, Xianting Tian wrote:
quoted hunk ↗ jump to hunk
diff --git a/block/blk-mq.c b/block/blk-mq.c
index b3d2785ee..62d152d03 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3256,9 +3256,11 @@ static int __blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
 {
 	int i;
 
-	for (i = 0; i < set->nr_hw_queues; i++)
+	for (i = 0; i < set->nr_hw_queues; i++) {
 		if (!__blk_mq_alloc_map_and_request(set, i))
 			goto out_unwind;
+		cond_resched();
+	}
 
 	return 0;
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help