[PATCH] block: avoid clearing blk_mq_alloc_data unnecessarily

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

 



We already set almost all of what we need here, just the non-plug
path needs to set nr_tags and clear cached.

Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>

---

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4dc0837f874d..eba34af1c5eb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2664,7 +2664,7 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
 {
 	struct blk_mq_alloc_data data = {
 		.q		= q,
-		.nr_tags	= 1,
+		.shallow_depth	= 0
 	};
 	struct request *rq;
 
@@ -2683,6 +2683,9 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
 		data.nr_tags = plug->nr_ios;
 		plug->nr_ios = 1;
 		data.cached_rq = &plug->cached_rq;
+	} else {
+		data.nr_tags = 1;
+		data.cached_rq = NULL;
 	}
 
 	rq = __blk_mq_alloc_requests(&data);

-- 
Jens Axboe




[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