From patchwork Mon Dec 5 18:27:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9461319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10F7B6071F for ; Mon, 5 Dec 2016 18:30:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F109927F54 for ; Mon, 5 Dec 2016 18:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E510E27F80; Mon, 5 Dec 2016 18:30:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9415027F54 for ; Mon, 5 Dec 2016 18:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbcLESag (ORCPT ); Mon, 5 Dec 2016 13:30:36 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40634 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbcLES1T (ORCPT ); Mon, 5 Dec 2016 13:27:19 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uB5IJNgT008157; Mon, 5 Dec 2016 10:27:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=9KoES/+g5h4kAuEt0VZsKzTfm2NnNQOUSiyzmF3Erhs=; b=Exs8o6vVdMswQiyVPnQb/k8vuDfmzJVZ+fjWJoZ7nhlUpG5sDXvlii18dphgDjs+V8D7 IBjve0ukEV5pZ5MryMSBqI7s7Mk12r3AH28tStxzzbJDrzkKxXNrqyHgsCDZKbtcy2y0 a9ck0vqkIoo9CDRM3LhOUbMS9+iMzlit5VM= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 27558kc59h-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 05 Dec 2016 10:27:17 -0800 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 5 Dec 2016 10:27:15 -0800 From: Jens Axboe To: , , CC: , Jens Axboe Subject: [PATCH 2/7] cfq-iosched: use appropriate run queue function Date: Mon, 5 Dec 2016 11:27:01 -0700 Message-ID: <1480962426-15767-3-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480962426-15767-1-git-send-email-axboe@fb.com> References: <1480962426-15767-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-05_14:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); } }