From patchwork Sat Oct 29 00:20:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9402899 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 ECBEB6022E for ; Sat, 29 Oct 2016 00:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DADD52A8A8 for ; Sat, 29 Oct 2016 00:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEFA82A8B6; Sat, 29 Oct 2016 00:20:24 +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=unavailable 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 3F2962A907 for ; Sat, 29 Oct 2016 00:20:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758131AbcJ2AUS (ORCPT ); Fri, 28 Oct 2016 20:20:18 -0400 Received: from mail-dm3nam03on0074.outbound.protection.outlook.com ([104.47.41.74]:12666 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753086AbcJ2AUO (ORCPT ); Fri, 28 Oct 2016 20:20:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bIqKBH/9DlWSqD2mC366adz0JAwDlbfovg+Hu8lgNnE=; b=QfBIguRmIWuJz4M2lVBon3jWPOyn3vI2WXUNiF7eaY6W1BNJp+sMyoV/DolmOyT2A9CVG9RGEZzIWKDMGk/IOJxkv/IMD79ujiHznHY2HZMzS2TxM99JV0p1uvwZO/VI7Qbuu6Wby5/8fiGhEu+I45390+RCiiZGy5FU1vcNkvg= Received: from CY1PR0201CA0015.namprd02.prod.outlook.com (10.163.30.153) by BY2PR02MB265.namprd02.prod.outlook.com (10.242.236.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Sat, 29 Oct 2016 00:20:11 +0000 Received: from BY2FFO11FD001.protection.gbl (2a01:111:f400:7c0c::179) by CY1PR0201CA0015.outlook.office365.com (2a01:111:e400:58b9::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12 via Frontend Transport; Sat, 29 Oct 2016 00:20:11 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BY2FFO11FD001.mail.protection.outlook.com (10.1.14.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.5 via Frontend Transport; Sat, 29 Oct 2016 00:20:10 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 08.A0.61581.4E8E3185; Fri, 28 Oct 2016 17:10:13 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 28 Oct 2016 17:20:02 -0700 X-AuditID: 0ac94371-952c29800000f08d-e9-5813e8e4f1f6 Received: from exp-402881.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 30.FF.02564.23BE3185; Fri, 28 Oct 2016 17:20:02 -0700 (PDT) Subject: [PATCH v5 04/14] blk-mq: Move more code into blk_mq_direct_issue_request() To: Jens Axboe References: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , Ming Lei , "Konrad Rzeszutek Wilk" , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Laurence Oberman , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" From: Bart Van Assche Message-ID: <2b30ad84-5b66-f475-7663-28d38b47e67a@sandisk.com> Date: Fri, 28 Oct 2016 17:20:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsXCddJ5ke7TF8IRBo0LWS3+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi2WLnzJa7L2lbTF/2VN2i2eHelksuq/vYLM4/+EVk8Xy4/+YLGac X8xq0bbxK6PF+x/X2R34PV5PnsDoMbH5HbvHzll32T0W73nJ5PHg0GYWj81L6j1232xg8/j4 9BaLx/t9V9k8Pm+SC+CK4rJJSc3JLEst0rdL4Mr4POEOW8EbkYpzrXsZGxj/CHQxcnJICJhI PD3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GZBdQl/sy7BGXLS2x/O4d5AiPfLCQts5CUzUJStoCReRWjWG5mTnFuemaB oaFecWJeSmZxtl5yfu4mRki0RO5gfDrR/BAjEwenVAPjzS2bo4NZTJxCzxzLKMuMP3fG/0QT I7fsy90zpPb+Vg2fnnxGZdn+qQ/mG+kydm1XPhKhPIOjYeWXVJ+3FlwN2/4HfW99+i//f2em SfDi4j0lGy73LvFYlJL7tCr6+6NkhVm9QW82rK54EznR2m9b+1zfu4WpVbXfF15jyUtfayvS cvGc5OvHSizFGYmGWsxFxYkACn1YW0YCAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(230700001)(2906002)(33646002)(92566002)(8666005)(4326007)(11100500001)(81156014)(305945005)(83506001)(97736004)(575784001)(8936002)(8676002)(87936001)(86362001)(4001350100001)(356003)(50466002)(7846002)(36756003)(229853001)(53416004)(2270400002)(189998001)(7416002)(626004)(31686004)(69596002)(77096005)(586003)(64126003)(81166006)(110136003)(31696002)(19580405001)(54356999)(47776003)(68736007)(2950100002)(65826007)(6916009)(50986999)(5660300001)(65806001)(23676002)(106466001)(65956001)(76176999)(19580395003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB265; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD001; 1:aXOR2dD61XtXl4eMWW4bgg6My07UHbABLOXH9q0NTDZ7xevAaTnHyRlMq28hLzJTGRmOAbKDCgJML3sLuxeXck32/fCdqnIDJPnNISm2/xHZqBbCiF7Q8OXpUqPiLqJ+Ar8mmu/sbb/q8qxFd8Lf/klXoirtDaNbMeFV9u7AuiwK2EnDIaKCvMxud8fa6Ixmk2lfcVQwA3AjjlfXPhWJtj2NI6VWcfoA4UDJbQGEvmNrdsOzBeMdgfkQo/sL3imlLbgLonfd0a9w8yeb4W7kJWqHtI/i6MBSDBCDCHp9D6mdSfv9GPWO8ZA0m2660Ym07NpeKNrw0BTQs5lcUniXJoC+E+VlsIpD+mfB5ddEZ81o6MX7vGtnGz6uk9OwW5DE5YzBZ1Igiq3cee4l7U5jk+lku5zxRK5syAvDA9NrZobsVP9j/8gs8SO8TR0rbvYeWXKg9WlmFaHIzVjuKw9D15Jju8crfd6A0sHO62qg7X0ryUXwrQTk28go/z8y2DwS34YHRQoPVSDkBPKGwJe3tXth3T5pWDVvsOyVSTPQ/IuV4CjKJCWjlCC28vB9+cuM X-MS-Office365-Filtering-Correlation-Id: f71f5a38-c6a1-4cd1-18b3-08d3ff915844 X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB265; 2:p7tj8tLl31E/8Evpjbm7VFmD+b1qL7rcmIo+udb9YyRDYdFKKEJozA60lFPiQLVOvAOr1VPALw2ehV/YMTh4P9ymv4Fnp1gvxEBqKAgqyvOQIY8aACt56+mot5xcvQCXcXDxBN5e5+An2GBdPJd44wWEaZaLqk6fI3ER4MgWrWfsuD0fl9T4UtfXIaQghZxmj8xrkdNJNoK4JRkl/bnJeg==; 3:hEC88Sfh2RL/nueymXOXcRlSaSuXFxG4uCsgD9ABDzBlCs/dyqilCMkZwei33Wh+m9t4hy0b/KQzX5BML8Bo+sxtjJ55T5sS9tcXwLRKc26uTUBlh2BeEPoFhzm7jAcui2MTJ4hAScqTWjKSBaFagsZFWrEEzkjNb/zm4U8kBe6t20JYZ0JBeYRzUwq1PTA4HqA4lTpDkVDCO4JypiyBlKSuu0L/HCK3LK6tdO7EF3n8Aviyv8jFJ0kkTiPSbsUVGm+Hx4pdvltkX8n/YoznLYJIxofu8GW74NtDqpnvGOw= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BY2PR02MB265; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB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DTyJ8+LgRpyEZH5rkuIj+Iup8m6xhQynMBtZe5lqyj4EAo8NbmZhyTmihQsICJhtplo90SrBdpunjvMz8Cvk7OM+cLF92a2Fm3wlQYnfdFelVuA4DPwH0/6+KPr6jb5SNLfRIeHWT6c5PT5P00RozEBIU4876DT56IZGuFBuHmX9ilvZyUGJe3MlYKtKYXhJ9pT3Xnh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(13016025)(13018025)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR02MB265; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB265; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB265; 4:jCt1a4zeJixnmkoB8pwQx96zXCnnumIVRv59tkSJbgd5qrIVfbDWZdXmMnXdj0bnk/Gb+Wuxu6KGWwybXFGeCvBfWQ/3WApcJDq/+BArDDkyYy1ucKi7DXyB4qM7oxo9qIVSLCusnhT3Vm0oMRNM8A6Y215ffhdinfkFcXTGl0JdnNdG3Jq4odkZzEeGa6umfc68gq5gfOnFBEYBTO5G1RUw+e3e/Ul+9TCvMAHs6q3MXaFFNsmU71581ddeM2/fKdaJrZgfPWtg7FE8Ba0lpNEoRpPGQWqJvmf+7wCbD3yvHf/Qas3X3SJjbZjq+EhMESvybrWp4tmBBDhVCQfTeelMVoDk4GabnK+Sf/YroXVSyOYfbCSRjgngMqSBzsje59lZ2lwzysVgs4PzLbUpx7Gx6TJmkPIqL9M45pzssq2p+TbN/euZ2FhFayEJwswDnv0A7GEFwTY5dkTG03p/IB13bgyKfDCdyGx70jLDpVCps+QaYtzG4ZhqFHPonjyC X-Forefront-PRVS: 01106E96F6 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyTUIyNjU7MjM6RWRITFpNVW5JVzRtZG4zbm1EOWN1VVZTZE5s?= =?utf-8?B?MHh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2MvNWl3VE9HQT09?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB265; 6:mgZwPnMxYr8G2ZzcYi9yR9G6sbcEHWqCZ65VQYwQ212jC1IKHJPMxmsEZzeMFYKAscGkE4iwsg6o31ShuUSEmxGLhx3fnWqNU9gCD59srMg9aY0dz1UInE1EqOtxuTV5Qn6iSjSohfBocb8O2FsceG7H9h8q4dpCwwXZN/dL9PRoLKoiyWQR9rS7EUVXfoSh52izZFi0UGftPaHJjeIC2YSt1Lvu1XMQNF1GoqSFA0GW4YiyPz5UV5+AQQojH94hO9+RiGqEgNZH2BqGOgU8SvdS4RZ5TOKz5Fq6BTLWRZsm0owwNSNp3c00nCBb+7gUUhetbAkcLPQ/7RJJ5dPhRyWXI3eqlT6ST8r9aI1UsZ8=; 5:a24C0bOe8i/8Y8FqzRhS98WRn9FgOKd2gcYhvHarqKPlTwf20kaOCcQFIiTNhH80spRKPOce3b+pLqxkfby8KFWz2Pm6cbGqeoXXfwAhmwn1CZaCwVaD8mjXRT56L1ZrO1RgtcOxwic5PO5j1748lg==; 24:b+PsK4yvuWiwdNAJchI9Z5umG0kNL6AGMKXYwCii83ltBQykO8Y5oaneS174oqaYXMIvX78Ms0VuJCj68HsD2MGIYII1WkOCy45ir/UJxrU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB265; 7:7rQdIWkamFkEys2TvRR9Dnznipxv2QsCTaFlHDPhEW5A4oUqbXHKBFoGdonUuE7QpYdd+REUH5U/Pyszg9GhsWFSaoMGAR1VpOMoQgIph0SeY8alZhG1AR87BgGS4k0sYlMht+qx37x7f8GwDVVd/j3cW10MSrvEWylpHxzDbI8eZcy9iLKwE8urU0GL9L4soN3iPJcGS0rl2sPKKVSQs2lUvJQDXhtFgE2pw2cT4APvu579Jwx62aZ9GfyDDgSc3nliffsb7zmtL6YJvHerueJLclZBiaB+hFimJUsJbLT3soQsvuBYkIVj4qfT9g4VUgjp39XdNALc0l0kK3+5o6XpbPUmSFPuKtfEh3yqvOE=; 20:+e2vAH47xnCO1S1vYBtXlLF954HK97vn/6ktOAgK597Fr9y3JbqtS/e/1/7sZAkLXXthR2Z44EorcwV2CZGeMulBqoMgPN8W45u4TBOvQFYj6ZU5Kd2CFcMQP+x2Dw6kLDMvlYslj87tHsSnv4UFbhDrbB6TlzS+NWbPTY/uzth24hfpOXsiTHRvtJ4NegMJ0leXEsZZWwKXsHiyJ8SH6BAURVP7SGKJwW8bG5AxmwROLAclQhCe+C66YSClZka4 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2016 00:20:10.4010 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB265 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the "hctx stopped" test and the insert request calls into blk_mq_direct_issue_request(). Rename that function into blk_mq_try_issue_directly() to reflect its new semantics. Pass the hctx pointer to that function instead of looking it up a second time. These changes avoid that code has to be duplicated in the next patch. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 283e0eb..c8ae970 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1243,11 +1243,11 @@ static struct request *blk_mq_map_request(struct request_queue *q, return rq; } -static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) +static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, + struct request *rq, blk_qc_t *cookie) { int ret; struct request_queue *q = rq->q; - struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, rq->mq_ctx->cpu); struct blk_mq_queue_data bd = { .rq = rq, .list = NULL, @@ -1255,6 +1255,9 @@ static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) }; blk_qc_t new_cookie = blk_tag_to_qc_t(rq->tag, hctx->queue_num); + if (blk_mq_hctx_stopped(hctx)) + goto insert; + /* * For OK queue, we are done. For error, kill it. Any other * error (busy), just add it to our list as we previously @@ -1263,7 +1266,7 @@ static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) ret = q->mq_ops->queue_rq(hctx, &bd); if (ret == BLK_MQ_RQ_QUEUE_OK) { *cookie = new_cookie; - return 0; + return; } __blk_mq_requeue_request(rq); @@ -1272,10 +1275,11 @@ static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie) *cookie = BLK_QC_T_NONE; rq->errors = -EIO; blk_mq_end_request(rq, rq->errors); - return 0; + return; } - return -1; +insert: + blk_mq_insert_request(rq, false, true, true); } /* @@ -1352,9 +1356,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_put_ctx(data.ctx); if (!old_rq) goto done; - if (blk_mq_hctx_stopped(data.hctx) || - blk_mq_direct_issue_request(old_rq, &cookie) != 0) - blk_mq_insert_request(old_rq, false, true, true); + blk_mq_try_issue_directly(data.hctx, old_rq, &cookie); goto done; }