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

Submitted by Konstantin Khorenko on June 6, 2019, 12:07 p.m.

Details

Message ID 201906061207.x56C7W95015569@finist-ce7.sw.ru
State New
Headers show

Patch hide | download patch | download mbox

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