[Devel] [PATCH RHEL7 COMMIT] Revert "blk-mq: issue directly if hw queue isn't busy in case of 'none'"

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jun 6 15:07:33 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.12.2.vz7.96.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.2.vz7.96.12
------>
commit 37cbdb7ded0de2ea28ddcf2a19ac99826241d4eb
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Jun 3 13:23:43 2019 +0300

    Revert "blk-mq: issue directly if hw queue isn't busy in case of 'none'"
    
    Thie reverts RedHat patch
    - [block] blk-mq: issue directly if hw queue isn't busy in case of
      'none' (Ming Lei) [1599682]
    
    https://pmc.acronis.com/browse/VSTOR-23501
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Original comment:
    
     From fc8cb9799f46a653d89d2743a7a62d4c75621cc8 Mon Sep 17 00:00:00 2001
     From: Ming Lei <ming.lei at redhat.com>
     Date: Fri, 20 Jul 2018 10:42:17 -0400
     Subject: [block] blk-mq: issue directly if hw queue isn't busy in case of 'none'
    
     Message-id: <20180720104217.5097-1-ming.lei at redhat.com>
     Patchwork-id: 225183
     O-Subject: [RHEL7.6] blk-mq: issue directly if hw queue isn't busy in case of 'none'
     Bugzilla: 1599682
     RH-Acked-by: Ewan Milne <emilne at redhat.com>
     RH-Acked-by: Jeff Moyer <jmoyer at redhat.com>
    
     BZ: 1599682
     BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17265471
    
     IOPS is observed with 15% improvement and CPU utilization is decreased
     meantime on megasas_raid, and the test is done by Kashyap.
    
     commit 6ce3dd6eec114930cf2035a8bcb1e80477ed79a8
     Author: Ming Lei <ming.lei at redhat.com>
     Date: Tue Jul 10 09:03:31 2018 +0800
    
         blk-mq: issue directly if hw queue isn't busy in case of 'none'
    
         In case of 'none' io scheduler, when hw queue isn't busy, it isn't
         necessary to enqueue request to sw queue and dequeue it from
         sw queue because request may be submitted to hw queue asap without
         extra cost, meantime there shouldn't be much request in sw queue,
         and we don't need to worry about effect on IO merge.
    
         There are still some single hw queue SCSI HBAs(HPSA, megaraid_sas, ...)
         which may connect high performance devices, so 'none' is often required
         for obtaining good performance.
    
         This patch improves IOPS and decreases CPU unilization on megaraid_sas,
         per Kashyap's test.
    
         Cc: Kashyap Desai <kashyap.desai at broadcom.com>
         Cc: Laurence Oberman <loberman at redhat.com>
         Cc: Omar Sandoval <osandov at fb.com>
         Cc: Christoph Hellwig <hch at lst.de>
         Cc: Bart Van Assche <bart.vanassche at wdc.com>
         Cc: Hannes Reinecke <hare at suse.de>
         Reported-by: Kashyap Desai <kashyap.desai at broadcom.com>
         Tested-by: Kashyap Desai <kashyap.desai at broadcom.com>
         Signed-off-by: Ming Lei <ming.lei at redhat.com>
         Signed-off-by: Jens Axboe <axboe at kernel.dk>
    
     Rename BLK_STS_OK as BLK_MQ_RQ_QUEUE_OK, and this commit is backported from
     block tree.
    
     Signed-off-by: Ming Lei <ming.lei at redhat.com>
     Signed-off-by: Bruno E. O. Meneguele <bmeneg at redhat.com>
    
     https://access.redhat.com/labs/psb/versions/kernel-3.10.0-957.el7/patches/block-blk-mq-issue-directly-if-hw-queue-isn-t-busy-in-case-of-none
---
 block/blk-mq-sched.c | 13 +------------
 block/blk-mq.c       | 23 +----------------------
 block/blk-mq.h       |  2 --
 3 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 13811a78b230..cbf636acc9d7 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -510,19 +510,8 @@ void blk_mq_sched_insert_requests(struct request_queue *q,
 
 	if (e && e->aux->ops.mq.insert_requests)
 		e->aux->ops.mq.insert_requests(hctx, list, false);
-	else {
-		/*
-		 * try to issue requests directly if the hw queue isn't
-		 * busy in case of 'none' scheduler, and this way may save
-		 * us one extra enqueue & dequeue to sw queue.
-		 */
-		if (!hctx->dispatch_busy && !e && !run_queue_async) {
-			blk_mq_try_issue_list_directly(hctx, list);
-			if (list_empty(list))
-				return;
-		}
+	else
 		blk_mq_insert_requests(hctx, ctx, list);
-	}
 
 	blk_mq_run_hw_queue(hctx, run_queue_async);
 }
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ab36454564be..39e1b926be6b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1691,15 +1691,12 @@ static int __blk_mq_issue_directly(struct blk_mq_hw_ctx *hctx, struct request *r
 	ret = q->mq_ops->queue_rq(hctx, &bd);
 	switch (ret) {
 	case BLK_MQ_RQ_QUEUE_OK:
-		blk_mq_update_dispatch_busy(hctx, false);
 		break;
 	case BLK_MQ_RQ_QUEUE_BUSY:
 	case BLK_MQ_RQ_QUEUE_DEV_BUSY:
-		blk_mq_update_dispatch_busy(hctx, true);
 		__blk_mq_requeue_request(rq);
 		break;
 	default:
-		blk_mq_update_dispatch_busy(hctx, false);
 		break;
 	}
 
@@ -1777,23 +1774,6 @@ int blk_mq_request_issue_directly(struct request *rq)
 	return ret;
 }
 
-void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
-		struct list_head *list)
-{
-	while (!list_empty(list)) {
-		int ret;
-		struct request *rq = list_first_entry(list, struct request,
-				queuelist);
-
-		list_del_init(&rq->queuelist);
-		ret = blk_mq_request_issue_directly(rq);
-		if (ret != BLK_MQ_RQ_QUEUE_OK) {
-			list_add(&rq->queuelist, list);
-			break;
-		}
-	}
-}
-
 static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
 {
 	const int is_sync = rw_is_sync(bio->bi_rw);
@@ -1885,8 +1865,7 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
 					same_queue_rq->mq_ctx->cpu);
 			blk_mq_try_issue_directly(data.hctx, same_queue_rq);
 		}
-	} else if ((q->nr_hw_queues > 1 && is_sync) || (!q->elevator &&
-			!data.hctx->dispatch_busy)) {
+	} else if (q->nr_hw_queues > 1 && is_sync) {
 		blk_mq_put_ctx(data.ctx);
 		blk_mq_bio_to_request(rq, bio);
 		blk_mq_try_issue_directly(data.hctx, rq);
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 02c8ef4858af..42929d71d840 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -77,8 +77,6 @@ void blk_mq_disable_hotplug(void);
 
 /* Used by blk_insert_cloned_request() to issue request directly */
 int blk_mq_request_issue_directly(struct request *rq);
-void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
-				    struct list_head *list);
 
 /*
  * CPU -> queue mappings



More information about the Devel mailing list