linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: <axboe@kernel.dk>, <linux-block@vger.kernel.org>
Cc: <paolo.valente@linaro.org>, Jens Axboe <axboe@fb.com>
Subject: [PATCH 2/7] cfq-iosched: use appropriate run queue function
Date: Fri, 2 Dec 2016 20:15:16 -0700	[thread overview]
Message-ID: <1480734921-23701-3-git-send-email-axboe@fb.com> (raw)
In-Reply-To: <1480734921-23701-1-git-send-email-axboe@fb.com>

For MQ devices, we have to use other functions to run the queue.
No functional changes in this patch, just a prep patch for
support legacy schedulers on blk-mq.

Signed-off-by: Jens Axboe <axboe@fb.com>
---
 block/cfq-iosched.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index c73a6fcaeb9d..d6d454a72bd4 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -919,8 +919,14 @@ static inline struct cfq_data *cic_to_cfqd(struct cfq_io_cq *cic)
 static inline void cfq_schedule_dispatch(struct cfq_data *cfqd)
 {
 	if (cfqd->busy_queues) {
+		struct request_queue *q = cfqd->queue;
+
 		cfq_log(cfqd, "schedule dispatch");
-		kblockd_schedule_work(&cfqd->unplug_work);
+
+		if (q->mq_ops)
+			blk_mq_run_hw_queues(q, true);
+		else
+			kblockd_schedule_work(&cfqd->unplug_work);
 	}
 }
 
@@ -4086,6 +4092,16 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 	cfq_mark_cfqq_slice_new(cfqq);
 }
 
+static void cfq_run_queue(struct cfq_data *cfqd)
+{
+	struct request_queue *q = cfqd->queue;
+
+	if (q->mq_ops)
+		blk_mq_run_hw_queues(q, true);
+	else
+		__blk_run_queue(q);
+}
+
 /*
  * Called when a new fs request (rq) is added (to cfqq). Check if there's
  * something we should do about it
@@ -4122,7 +4138,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 			    cfqd->busy_queues > 1) {
 				cfq_del_timer(cfqd, cfqq);
 				cfq_clear_cfqq_wait_request(cfqq);
-				__blk_run_queue(cfqd->queue);
+				cfq_run_queue(cfqd);
 			} else {
 				cfqg_stats_update_idle_time(cfqq->cfqg);
 				cfq_mark_cfqq_must_dispatch(cfqq);
@@ -4136,7 +4152,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 		 * this new queue is RT and the current one is BE
 		 */
 		cfq_preempt_queue(cfqd, cfqq);
-		__blk_run_queue(cfqd->queue);
+		cfq_run_queue(cfqd);
 	}
 }
 
-- 
2.7.4

  parent reply	other threads:[~2016-12-03  3:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03  3:15 [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq Jens Axboe
2016-12-03  3:15 ` [PATCH 1/7] block: use legacy path for flush requests for MQ with a scheduler Jens Axboe
2016-12-05 13:05   ` Christoph Hellwig
2016-12-05 15:07     ` Jens Axboe
2016-12-05 15:49       ` Johannes Thumshirn
2016-12-05 15:49         ` Jens Axboe
2016-12-05 22:40       ` Mike Snitzer
2016-12-05 22:50         ` Jens Axboe
2016-12-06 19:50           ` Mike Snitzer
2016-12-05 17:00   ` Ming Lei
2016-12-05 17:09     ` Jens Axboe
2016-12-05 19:22       ` Ming Lei
2016-12-05 19:35         ` Jens Axboe
2016-12-03  3:15 ` Jens Axboe [this message]
2016-12-05  8:48   ` [PATCH 2/7] cfq-iosched: use appropriate run queue function Johannes Thumshirn
2016-12-05 15:12     ` Jens Axboe
2016-12-05 15:18       ` Johannes Thumshirn
2016-12-05 13:06   ` Christoph Hellwig
2016-12-05 15:08     ` Jens Axboe
2016-12-03  3:15 ` [PATCH 3/7] block: use appropriate queue running functions Jens Axboe
2016-12-05  9:01   ` Johannes Thumshirn
2016-12-05 13:07   ` Christoph Hellwig
2016-12-05 15:10     ` Jens Axboe
2016-12-05 17:39       ` Jens Axboe
2016-12-03  3:15 ` [PATCH 4/7] blk-mq: blk_account_io_start() takes a bool Jens Axboe
2016-12-05  9:01   ` Johannes Thumshirn
2016-12-05 13:08   ` Christoph Hellwig
2016-12-03  3:15 ` [PATCH 5/7] blk-mq: test patch to get legacy IO schedulers working Jens Axboe
2016-12-03  3:15 ` [PATCH 6/7] block: drop irq+lock when flushing queue plugs Jens Axboe
2016-12-03  3:15 ` [PATCH 7/7] null_blk: add parameters to ask for mq-sched and write cache Jens Axboe
2016-12-03  4:02 ` [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq Jens Axboe
2016-12-03  4:04   ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2016-12-05 18:26 [PATCHSET/RFC v2] " Jens Axboe
2016-12-05 18:27 ` [PATCH 2/7] cfq-iosched: use appropriate run queue function Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480734921-23701-3-git-send-email-axboe@fb.com \
    --to=axboe@fb.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).