From patchwork Tue Feb 28 10:25:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9595099 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 32E6A60453 for ; Tue, 28 Feb 2017 10:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3EF27F60 for ; Tue, 28 Feb 2017 10:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30DAC28520; Tue, 28 Feb 2017 10:28:32 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 8C75F28518 for ; Tue, 28 Feb 2017 10:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdB1K2b (ORCPT ); Tue, 28 Feb 2017 05:28:31 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:45148 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbdB1K22 (ORCPT ); Tue, 28 Feb 2017 05:28:28 -0500 X-IronPort-AV: E=Sophos;i="5.35,218,1483977600"; d="scan'208";a="99640233" Received: from mail-sn1nam02lp0021.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.21]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2017 18:26:04 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Z00tnMl4TIvoQhqu6XD5G4/2VS+T3S+yfzqKSHYSffw=; b=EmGXCWfE8fnmxUMhGNokDYS4sAUD8Kc1PJCO74lIEEs703VkmXTJ2Wcdh77TFBbJy6a68//O6OoTdAah48aDTB8zAM/9j5tjmQlF8wNXV4czuUyLFVjC8t5HG9WfzyI4A6ZV6Rw/8Lka3NDvbrW2XSWVC1r7KjB52rxdHfX5tKY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; Received: from washi.fujisawa.hgst.com (199.255.44.5) by BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Tue, 28 Feb 2017 10:26:01 +0000 From: Damien Le Moal To: Jens Axboe , linux-block@vger.kernel.org, "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: MPT-FusionLinux.pdl@broadcom.com, Hannes Reinecke , Christoph Hellwig , Bart Van Assche Subject: [PATCH 2/3] block: Separate zone requests from medium access requests Date: Tue, 28 Feb 2017 19:25:34 +0900 Message-Id: <20170228102535.15966-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170228102535.15966-1-damien.lemoal@wdc.com> References: <20170228102535.15966-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Originating-IP: [199.255.44.5] X-ClientProxiedBy: MWHPR1201CA0013.namprd12.prod.outlook.com (10.174.253.23) To BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) X-MS-Office365-Filtering-Correlation-Id: e8a494d5-bdf5-44a8-94b2-08d45fc43270 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:BY2PR04MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 3:rAQJHtah5ZnZJXO6pS0THwb9RqWTqJYR05uPeNShX81fg+M5wT5xZOfYhBTD7pKgMM5RG6hBf6oWwzavBpfTih42t2yXgC+EtDvcZ11dctmCx1dxMcvMOWskEQO7ICS6cofKozxtLPq8hI2l99kUoEYCIwzOqKKTZCJPRzlSvPHO+NWXNSq0SHTaIDFWyyGvDGMxvEktzVNwWKc5atoYG/mGxSvzio8KrJIlnYkD/FMdDsLeDVBk1hF5i06fNwHgYkN10dk+eXd1aJvD//xiZXZudeT/XjPWomerUfVuQI8=; 25:Mohe4eiwYzzw/oQVxWhgqHcpEmlI21vNScstNFTmIjJN7AV9mvElg63iSwhCjB237Oz/LDvPMrW+qtV8lcmorworfyEF9/FoS9SMbbYh7KEvwHBzc0k4fcOCZFJsCA99FLv9oFXCnjP/ysVezrYY7XrWptkxJvN11xrwqssosk7gIW0TSXLuKDViWMJ5MORzl7ekmXw+Syw5DOEsd/Rb05eRxqu9FmPbzz+HFf7AfkqCaD3yQdnekBCQe+siDjOADMvHfarNVK+LRoyyQIcHEzKuHEFErz3Bj2OFht6jl3wScTNoMRlzpYCHqszZcumecb+3WM7y3r3w8BTOYaL3gHgPvDyspTPWE3lAfXulpus5fab+CCoLsvP+g2HOuQY7g/muS6Amoazlg70pYAIECUE/Fh4ef9m9yCI+Q0VN6rP/LzSD+yvMqRibjbbizlJxrm52ExF5bSk2JWs9kaympw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 31:cPPH4TeTb+gyEi4+DSb7VwHlbO+BTN9G7PmznnAz01tl4WTziYeeBZ8S5oPcEi/v5ncsPiMwT1J0nIqjBZFX5aMyHui7YI96FhBRtZC+aPPPmwf6yAG+/PLxlNJjdXV4mhfEb6a17Q5utJJQSicrrKCK8ZGHwtsD3AYdWwTu4Z8uaMYCIKkszfQIF91bF2/tH1LwnzRJCkdu0zkh7pMoP8jtfwd5OMkD58LJS2vHl3mWdQasRPMxBYfEZnkd4Q5q; 20:amzEKFQ2wPxyW+8x0BjduwrE0EmjKogEEPmTszG88F//lkYU+/Jfhl8y9ZCAVexyeYWmXxmTRdovbwXy0ezGyunGSMLX19N+4qXSj1yP/w6thANA3ooeQ/YeIpMAd9ngpEAtMZh6xWEmIBzvxRSM4VzKDh7v4uDst+7vQ9tppq5gk6zEUqixp1oVoM/T9eXXx9NKY9XB605HdkLnsnAtxuVVAnfeJQocELmIDi76B/1RMwJxbxRT0WK5iaZDJkSR6VQ4WrOODnMf47RUqxJA1VaCZ+pDUAZvqqdspS2sKWU77fTJBcesNyRRYEvKSEGVgrE8BK8zNlKIV3PBAx6ZzBl+/gXng32M2lwc3HOaohe6JL8THKHvrtTUYggmwh7q1l/ZSZ8WJeTSd0baVHefZdElrUBlAAq6sMXt4GqBihv38r8R5E45R6s03rAQA5dDNC9ZYTSwr80fObGlmEeiuJczyw86kBWQiCedVNpVps1GnF3oRjuLeKcTVi2Rufqo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BY2PR04MB1973; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 4:ztdGL0pq6ZvBUhit/Lrd9cZNae/rKK0vGcWP8S7oW/afHyp8an5zXAooZupF8TUxrB8Md2eRjXDvPC9Y58VKuILN7sZNsSOfkZ4Ii3B2W8lNs8JM1NnFASnhaI7W0XFdcSR07w+DkV1mdHd89yMY/y/HqUyhs7KF7EcxOZ8SP/GTBRnmiLHSZTlC+9/DfSBttl9fiw2EkYt/h7e4E5WrjVXkjsje1p4ha8an/nMIBShueyvwoa3UKsM89Wd0ddf0OgdjMLjzEGAZdrz9EFM6tnhCcgOyNcOUqeMpeL6VS99xhOyhJhu1paLpO2397m9sRGLKV9rvy8lAfXmTVsivAUMldzfuoYQIdzKe2/3Uh8wf91S8AOds4MTpA1UYN/cxa406tuJxo5WGspFy8Kz5h5YXcw7GZ0Vyr100dlIABS3UCmRfiQnxU2yEJSVm16TmhZZOnsSasOS8JwrLO59BtAOiuihuiux/N/i5wJf7xG3J6dyP6GT2u+9adcBIKgcFV7TvfOvC0v04Ux/Qw+53AlvhhQYCFFYsi4FYUPdjCivlKOd1DsnPxc6iaFKKne9H3k8gXVSvJwqa4taKje12LQlgBBLWiYRkyAepBHP9ttmcxIpvuU78Pacf6QiHNjFcpvD3Ufg8cWPcWoZq38f52eSX8A8WUlYgFLJQcIQ0QZw= X-Forefront-PRVS: 0232B30BBC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(199003)(189002)(51234002)(6506006)(6666003)(36756003)(101416001)(2950100002)(6486002)(50226002)(189998001)(81166006)(81156014)(76176999)(50466002)(54906002)(6512007)(50986999)(25786008)(305945005)(7736002)(5660300001)(8676002)(97736004)(48376002)(53936002)(92566002)(2906002)(4326007)(33646002)(6116002)(107886003)(38730400002)(3846002)(5003940100001)(1076002)(105586002)(106356001)(68736007)(42186005)(86362001)(66066001)(47776003)(7099028)(5005270100013); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1973; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR04MB1973; 23:WvXA5plJhFgyHSW2AVZ8NE9wSgg4nroiXc8e2SrH/?= =?us-ascii?Q?gMdLWcDYcfRaY+4YScmFzs4AdxsB+4x4cgjqvEnf3aqXwx1HhJN58VN+hPLq?= =?us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ji0UMFU7vhiZQ0EXv+Xx9vlGgKt3ElTx4kH8++2I2yly/sqSuUUAEZkrBLzkZZBC3NU0UscLk4aZwW2/eqcNOR0wM3HLNazgY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 7:xkXMI6ZEUbMUvA+qJh1K2hWp9tXrl+wEVmdl8XnTPn1eoQ60WCGPyxPSQizK084k4pXpAXEEt4zdaD8/IRC7wUST4BgrAg1PF/JFs+5He5V9sz9h8ZZgxMN1uK+0DjTSmW2ObA9gFdmVjjs6FaZFwkOGscS5o7roqRO5Nsm16d+ch+1lU+RUVZCPtxQZDizUgGpk3Di0S5v5bsTFuyCmSKdYJbEtNNTd+cMz1nlseK0uGmhQYkUx4k6N69XV9Y5LdKKVnQvL4lTI6xeGZD6pkfxjzW8AaKXDpfvBoaKBpo9O2voTHM4u+EneZ9Dn2E2q8xf8Rir3w5F34Lqnds/dXw==; 20:VwT3KJKTfJfkMnbMQK9UEd+mY6cqAmWYFGwNq1e/o9t++QxxBK/mQW2WZvDuEqcCFdqfExzwy6+bUNz8AZJ3wWw34gTNCDQ3woPdMpljbzIt+wovfxrbAs11ETTf+cPMbWOiL/OkrxETZ39xWs2wuMIXTuaCw9RfiZFTiTG1MOcaOSL1+xMlJANYkw/qLk5cvhBHFpCGo1ICymacz1wELHVf75OkahOvOavUN1MbJRyaGcoY4De/LmNu+hGYUjIZ X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2017 10:26:01.1330 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1973 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 From: Bart Van Assche Use blk_rq_accesses_medium() instead of !blk_rq_is_passthrough() to ensure that code that is intended for normal medium access requests, e.g. DISCARD, READ and WRITE requests, is not applied to REQ_OP_ZONE_REPORT requests nor to REQ_OP_ZONE_RESET requests. This allows excluding these zone requests from request accounting and from request scheduling. Signed-off-by: Bart Van Assche --- block/blk-core.c | 2 +- block/blk.h | 2 +- block/elevator.c | 12 ++++++++---- block/mq-deadline.c | 2 +- include/linux/blkdev.h | 6 +++--- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index b9e857f..addd8e1 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2608,7 +2608,7 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) req->__data_len -= total_bytes; /* update sector only for requests with clear definition of sector */ - if (!blk_rq_is_passthrough(req)) + if (blk_rq_accesses_medium(req)) req->__sector += total_bytes >> 9; /* mixed attributes always follow the first bio */ diff --git a/block/blk.h b/block/blk.h index d1ea4bd9..9b63db7 100644 --- a/block/blk.h +++ b/block/blk.h @@ -255,7 +255,7 @@ static inline int blk_do_io_stat(struct request *rq) { return rq->rq_disk && (rq->rq_flags & RQF_IO_STAT) && - !blk_rq_is_passthrough(rq); + blk_rq_accesses_medium(rq); } static inline void req_set_nomerge(struct request_queue *q, struct request *req) diff --git a/block/elevator.c b/block/elevator.c index 699d10f..cbf81c6 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -635,16 +635,20 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) rq->q = q; - if (rq->rq_flags & RQF_SOFTBARRIER) { + if (!blk_rq_accesses_medium(rq)) { + /* Do not schedule zone requests */ + where = ELEVATOR_INSERT_FRONT; + } if (rq->rq_flags & RQF_SOFTBARRIER) { /* barriers are scheduling boundary, update end_sector */ - if (!blk_rq_is_passthrough(rq)) { + if (blk_rq_accesses_medium(rq)) { q->end_sector = rq_end_sector(rq); q->boundary_rq = rq; } } else if (!(rq->rq_flags & RQF_ELVPRIV) && (where == ELEVATOR_INSERT_SORT || - where == ELEVATOR_INSERT_SORT_MERGE)) + where == ELEVATOR_INSERT_SORT_MERGE)) { where = ELEVATOR_INSERT_BACK; + } switch (where) { case ELEVATOR_INSERT_REQUEUE: @@ -679,7 +683,7 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) if (elv_attempt_insert_merge(q, rq)) break; case ELEVATOR_INSERT_SORT: - BUG_ON(blk_rq_is_passthrough(rq)); + BUG_ON(!blk_rq_accesses_medium(rq)); rq->rq_flags |= RQF_SORTED; q->nr_sorted++; if (rq_mergeable(rq)) { diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 23612163..389c1af 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -399,7 +399,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, blk_mq_sched_request_inserted(rq); - if (at_head || blk_rq_is_passthrough(rq)) { + if (at_head || !blk_rq_accesses_medium(rq)) { if (at_head) list_add(&rq->queuelist, &dd->dispatch); else diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7d1ce2d..dcf926d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -720,7 +720,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) static inline bool blk_account_rq(struct request *rq) { - return (rq->rq_flags & RQF_STARTED) && !blk_rq_is_passthrough(rq); + return (rq->rq_flags & RQF_STARTED) && blk_rq_accesses_medium(rq); } #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) @@ -796,7 +796,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync) static inline bool rq_mergeable(struct request *rq) { - if (blk_rq_is_passthrough(rq)) + if (!blk_rq_accesses_medium(rq)) return false; if (req_op(rq) == REQ_OP_FLUSH) @@ -1070,7 +1070,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq, { struct request_queue *q = rq->q; - if (blk_rq_is_passthrough(rq)) + if (!blk_rq_accesses_medium(rq)) return q->limits.max_hw_sectors; if (!q->limits.chunk_sectors ||