[PATCH 07/11] block: optimize do_make_request for direct to blk-mq issue

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

 



Don't bother with reshuffling the on-stack bio list if we know that we
directly issue to a request based driver that can't re-inject bios.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 block/blk-core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index e8c48203b2c55..d196799e68881 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1035,10 +1035,7 @@ static blk_qc_t do_make_request(struct bio *bio,
 
 	if (unlikely(bio_queue_enter(bio) != 0))
 		return BLK_QC_T_NONE;
-	if (q->make_request_fn)
-		ret = q->make_request_fn(q, bio);
-	else
-		ret = blk_mq_make_request(q, bio);
+	ret = q->make_request_fn(q, bio);
 	blk_queue_exit(q);
 
 	/*
@@ -1092,7 +1089,10 @@ static blk_qc_t __generic_make_request(struct bio *bio)
 
 	current->bio_list = bio_list_on_stack;
 	do {
-		ret = do_make_request(bio, bio_list_on_stack);
+		if (bio->bi_disk->queue->make_request_fn)
+			ret = do_make_request(bio, bio_list_on_stack);
+		else
+			ret = __direct_make_request(bio);
 	} while ((bio = bio_list_pop(&bio_list_on_stack[0])));
 	current->bio_list = NULL; /* deactivate */
 
-- 
2.26.1




[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