From patchwork Mon Sep 19 21:27:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9340567 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 A54AF607D0 for ; Mon, 19 Sep 2016 21:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9543329906 for ; Mon, 19 Sep 2016 21:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A2482990B; Mon, 19 Sep 2016 21:28:46 +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 9247C29906 for ; Mon, 19 Sep 2016 21:28:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932691AbcISV2o (ORCPT ); Mon, 19 Sep 2016 17:28:44 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:15941 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932422AbcISV2m (ORCPT ); Mon, 19 Sep 2016 17:28:42 -0400 X-IronPort-AV: E=Sophos;i="5.30,363,1470672000"; d="scan'208";a="15969643" Received: from mail-bn3nam01lp0180.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.180]) by ob1.hgst.iphmx.com with ESMTP; 20 Sep 2016 05:28:02 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-hgst-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rLdj0rT7Sfpoc9oP9k+fTUalSOuYVvb8Oi1UXg8Pp/0=; b=f4QdzwfdFDeHxQNe8Ej7BGR1E+XSKdHEszfKn+S2SI7ezYrfOzl8PB/5tjZEVLmndlBb29/mgk9FQpYQDbVIFNx307d9R4+RgWuE8Tr1VlgWB8g46ZdsHODp6DgeRfwFXm2m6oI8qUOAbCTBVg037nJrDrqF3zjIFAnT2HDLL30= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from localhost.localdomain.localdomain (4.28.11.153) by BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Mon, 19 Sep 2016 21:27:56 +0000 From: Damien Le Moal To: , CC: , , , , Damien Le Moal Subject: [PATCH 4/9] block: Define zoned block device operations Date: Tue, 20 Sep 2016 06:27:29 +0900 Message-ID: <1474320454-5264-5-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> References: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [4.28.11.153] X-ClientProxiedBy: BY2PR12CA0038.namprd12.prod.outlook.com (10.160.121.48) To BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) X-MS-Office365-Filtering-Correlation-Id: fde0fb2e-3831-4381-a806-08d3e0d3d2ef X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 2:cXi6rlCTKy7ni/Cb6c+THrRI4hPhHqxPNRU+TQMwot9mzoq7K6kbB2Ouo4KIiGXtSqhphIlqGdDs/L7XuPdbjf+mqHYjixaOvtedUOkd93MYD/pqeZreedc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== X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 31:cuXnK7IYvoW5EmBtNqoScto17vp2wvNSOPxl6iUpLFYI6H6SVRQZl5018s7oKCNPw5kfbddkYC47oEN6xlgpe8cd6MzYj552XYEr0VfP5aQrlH3RV76XiHCv/y/cMFFGFPdoL2GOH2eNcbkdBMLbQH51BuvgVPrp/3xA8tv7CtRm7bB4qAmInVBqQ0aBijYr2W+Og+rXAe5xbzxDdTCQBnvblCZLFx8037XUOUiZQZs=; 20:1D/UM3GDHy/KH0ifx20kNN8AiQC5SpBb+iLDSQsrmJQcPf2A5atX2nTDfHnkzUi1e0Ko0BdMaBhKsziymAXeghqvKGVdKk9tc05HMW5C5HgcR8kCQGwB6l/dU/KseeJLrRN6KW+EILRtOpyrPpLh4Tm2nzD5e6mtVC/14+dHm5mmbZvzjfXlDqDvjRvUz49OxA24mYTaggjS+N+AbnobU+QosbxuF3jVZgjVh4QZ0R+MYvtIsfEZQKjDKwxJSuCsevLeP3YMw3uoXtdV0cMEokwfDXssb3jC/IfB7DNfGRId0sc37eWp/sOS7WUKNexecYR7YHYj/9nXu91xkMdCK83LAuZgOLtYR60SvkIGQN0QyD5iYPKZc6v3WpWHP1p7uTo7bhlZ5lL3rBuHwcd6Y4TmFXOpdcs+8LiE0DHKcJiJR7pEdm9LiRIUqyaTBnrfcWcY3D/xErLKbvwC3q6m5xJD0oEfBsgC6lMxPLrSRKQKqIDVN9Tn2gS9FYOMRwDR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR04MB1975; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1975; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 4:+ChNfHhsvJ3Y4UHmqXKIbQxn91hUJQ7Dv+1QPCIn6TV9V96mIJkZ+9OxNoGxutYHeIA+G54Srd6ujS9jTqgBCEotpWcSbtY7u/UrgI+omOI/xoGCwF0GbhEvYir1gFWg2eB4r58zoLxHp4m7nnE0zT7u32kke4EYc+s2sxlc5axBySY7FHEFaSN3b4sM+ATckLq74Ico7+EFDGdewbKs8Hu3b9F1f/ql5TFJxpZj9TPaZR0w0RfZTIVKUpgnHt/LbqxrMIlQ6zWHfIBDEBLkY9a5y0hSeGdxg2E7bNV3Q/D/E9OoEUFgXNdRDfLTpHA1CGMG7xCJYku8bdo2j0O3gcYiXPDgBgT1cKyTpjJOziskl0qs5wh+6w+My/qtBztZHIt6mw7jwEv3hw3Ow6VhPNeE6csrUO7AQogMmbazggySn4nRlGNzG2R+J+XXDHXxff9FlbzBPGEGrGuc07XcCQ== X-Forefront-PRVS: 0070A8666B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(199003)(54534003)(189002)(4001430100002)(305945005)(5660300001)(2950100001)(5003940100001)(86362001)(47776003)(33646002)(66066001)(97736004)(5001770100001)(50986999)(2906002)(229853001)(6116002)(4326007)(3846002)(76176999)(189998001)(101416001)(106356001)(105586002)(586003)(42186005)(77096005)(36756003)(50466002)(48376002)(19580405001)(81166006)(37156001)(92566002)(7736002)(8676002)(50226002)(68736007)(19580395003)(81156014)(7846002)(107886002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1975; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: hgst.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR04MB1975; 23:rC4Cw2P2SEyCnTGkqpEmiFVaW1X1u4+467n1UkraG?= =?us-ascii?Q?RDScbhM+ljx6Ggd1UblGOzg3a/mkIUYsSz2akOaInL0KoKoOtTEdtr1zH/vH?= =?us-ascii?Q?QDs/+Q+b/FeMN0jN+RYg67xbwguBLcyh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+Wxjj3YBFe1wXOjjwAW5jKCGBAKQmPCasGmboyTuAJfev600bOGnwYzTvccZm3lEQ2LHyg0jTAtmFGaWvcT1DMsdoM6JzTp5ctx6l SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 20:Ib8WMJqVruHSQYaOl/JZVfYHF89TytfbmuzC6s2f2XETDgOUScvrvxqoW8b1+R2z0pzlHk3/Oocr0ZXWDeAbTSSnzmKfwZveMo64BFs37QmlFpzUsLMi9cw3M6RZP3DlnSTGvd8QcuBRfs6PM+5yz/64r3iXguo9vllh6PeMsB69yjm8zSiQ0W9TqJm6A/9o7Pav5VDim0kEnwwSaSsZD92WhzMNt476RshCb4nn8q9R3YqxFZuBVIbSnqJY11I5 X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2016 21:27:56.7772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1975 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: Shaun Tancheff Define REQ_OP_ZONE_REPORT, REQ_OP_ZONE_RESET, REQ_OP_ZONE_OPEN, REQ_OP_ZONE_CLOSE and REQ_OP_ZONE_FINISH for handling zones of zoned block devices (host-managed and host-aware). With with these new commands, the total number of operations defined reaches 11 and requires increasing REQ_OP_BITS from 3 to 4. Signed-off-by: Shaun Tancheff Changelog (Damien): All requests have no payload and may operate on all zones of the device (when the BIO sector and size are 0) or on a single zone (when the BIO sector and size are aigned on a zone). REQ_OP_ZONE_REPORT is not sent directly to the device and is processed in sd_zbc.c using the device zone work in order to parse the report reply and manage changes to the zone information cache of the device. Signed-off-by: Damien Le Moal --- block/blk-core.c | 7 +++++++ block/blk-merge.c | 31 +++++++++++++++++++++++++++---- include/linux/bio.h | 36 +++++++++++++++++++++++++++--------- include/linux/blk_types.h | 27 ++++++++++++++++++++++++++- 4 files changed, 87 insertions(+), 14 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 36c7ac3..4a7f7ba 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1941,6 +1941,13 @@ generic_make_request_checks(struct bio *bio) case REQ_OP_WRITE_SAME: if (!bdev_write_same(bio->bi_bdev)) goto not_supported; + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: + if (!bdev_zoned(bio->bi_bdev)) + goto not_supported; break; default: break; diff --git a/block/blk-merge.c b/block/blk-merge.c index 2642e5f..f9299df 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -202,6 +202,21 @@ void blk_queue_split(struct request_queue *q, struct bio **bio, case REQ_OP_WRITE_SAME: split = blk_bio_write_same_split(q, *bio, bs, &nsegs); break; + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: + /* + * For these commands, bi_size is either 0 to specify + * operation on the entire block device sector range, + * or a zone size for operation on a single zone. + * Since a zone size may be much bigger than the maximum + * allowed BIO size, we cannot use blk_bio_segment_split. + */ + split = NULL; + nsegs = 0; + break; default: split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs); break; @@ -241,11 +256,19 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, * This should probably be returning 0, but blk_add_request_payload() * (Christoph!!!!) */ - if (bio_op(bio) == REQ_OP_DISCARD || bio_op(bio) == REQ_OP_SECURE_ERASE) - return 1; - - if (bio_op(bio) == REQ_OP_WRITE_SAME) + switch(bio_op(bio)) { + case REQ_OP_DISCARD: + case REQ_OP_SECURE_ERASE: + case REQ_OP_WRITE_SAME: + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: return 1; + default: + break; + } fbio = bio; cluster = blk_queue_cluster(q); diff --git a/include/linux/bio.h b/include/linux/bio.h index 23ddf4b..d9c2e21 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -69,20 +69,38 @@ */ static inline bool bio_has_data(struct bio *bio) { - if (bio && - bio->bi_iter.bi_size && - bio_op(bio) != REQ_OP_DISCARD && - bio_op(bio) != REQ_OP_SECURE_ERASE) - return true; + if (!bio || !bio->bi_iter.bi_size) + return false; - return false; + switch (bio_op(bio)) { + case REQ_OP_DISCARD: + case REQ_OP_SECURE_ERASE: + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: + return false; + default: + return true; + } } static inline bool bio_no_advance_iter(struct bio *bio) { - return bio_op(bio) == REQ_OP_DISCARD || - bio_op(bio) == REQ_OP_SECURE_ERASE || - bio_op(bio) == REQ_OP_WRITE_SAME; + switch (bio_op(bio)) { + case REQ_OP_DISCARD: + case REQ_OP_SECURE_ERASE: + case REQ_OP_WRITE_SAME: + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: + return true; + default: + return false; + } } static inline bool bio_is_rw(struct bio *bio) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 436f43f..70df996 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -229,6 +229,26 @@ enum rq_flag_bits { #define REQ_HASHED (1ULL << __REQ_HASHED) #define REQ_MQ_INFLIGHT (1ULL << __REQ_MQ_INFLIGHT) +/* + * Note on zone operations: + * All REQ_OP_ZONE_* commands do not have a payload and share a common + * interface for specifying operation range: + * (1) bio->bi_iter.bi_sector and bio->bi_iter.bi_size set to 0: + * the command is to operate on ALL zones of the device. + * (2) bio->bi_iter.bi_sector is set to a zone start sector and + * bio->bi_iter.bi_size is set to the zone size in bytes: + * the command is to operate on only the specified zone. + * Operation: + * REQ_OP_ZONE_REPORT: Request information for all zones or for a single zone. + * REQ_OP_ZONE_RESET: Reset the write pointer of all zones or of a single zone. + * REQ_OP_ZONE_OPEN: Explicitely open the maximum allowed number of zones or + * a single zone. For the former case, the zones that will + * actually be open are chosen by the disk. + * REQ_OP_ZONE_CLOSE: Close all implicitely or explicitely open zones or + * a single zone. + * REQ_OP_ZONE_FINISH: Transition one or all open and closed zones to the full + * condition. + */ enum req_op { REQ_OP_READ, REQ_OP_WRITE, @@ -236,9 +256,14 @@ enum req_op { REQ_OP_SECURE_ERASE, /* request to securely erase sectors */ REQ_OP_WRITE_SAME, /* write same block many times */ REQ_OP_FLUSH, /* request for cache flush */ + REQ_OP_ZONE_REPORT, /* Get zone information */ + REQ_OP_ZONE_RESET, /* Reset a zone write pointer */ + REQ_OP_ZONE_OPEN, /* Explicitely open a zone */ + REQ_OP_ZONE_CLOSE, /* Close an open zone */ + REQ_OP_ZONE_FINISH, /* Finish a zone */ }; -#define REQ_OP_BITS 3 +#define REQ_OP_BITS 4 typedef unsigned int blk_qc_t; #define BLK_QC_T_NONE -1U