From patchwork Wed Sep 28 08:45:33 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: 9353335 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 61F1760756 for ; Wed, 28 Sep 2016 08:46:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52F872942F for ; Wed, 28 Sep 2016 08:46:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4722D29457; Wed, 28 Sep 2016 08:46:57 +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 E298A2942F for ; Wed, 28 Sep 2016 08:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752248AbcI1Iqt (ORCPT ); Wed, 28 Sep 2016 04:46:49 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:26240 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbcI1Iqo (ORCPT ); Wed, 28 Sep 2016 04:46:44 -0400 X-IronPort-AV: E=Sophos;i="5.30,409,1470672000"; d="scan'208";a="18827603" Received: from mail-bn3nam01lp0182.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.182]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 16:46:43 +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=tI4udoUPkQGNes7a3meK3nZlPhNavgeYp2zNrrFKwB8=; b=Lr3JLdGj5O45llH2yWMIfW/lCEJQnZrt04VhxPe76N81WvoAtaUoTCCwuL4oJMbCF9toqpMuaccgREvLPJzJDy2qX9UCNIoWpb4voM5Qe3Ca1O7FSKLt3K96KDySwCULpFWe2LWlVSmN54yA7PpGneElbT4ETSV+CywGyprzoaQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 28 Sep 2016 08:46:39 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v4 1/7] block: Add 'zoned' queue limit Date: Wed, 28 Sep 2016 17:45:33 +0900 Message-ID: <1475052339-10202-2-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> References: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CO2PR18CA0029.namprd18.prod.outlook.com (10.161.80.39) To SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) X-MS-Office365-Filtering-Correlation-Id: 747f6def-3fe7-4a3f-1934-08d3e77bf7ce X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 2:mQytYHhnQpk9l/BJ8J24G+wB4oTC3UfIrFSBkBSujEo44FFlkZOtm6NdwDXz7qSKW9s47ponc/utaHjCHhypYDj1M24kau8mdWifpbcis3KB9ftNITq1hLXd/JuEqyuNUYum9vLLCZoYHWtUNaaNiR83m2RYL7eC6zxdGR8zRIhqw96lw/Tlzy6yxC+Aboal; 3:MuAj6SMWvvbrV42xh8rhGaWJHFbHijE6m4ldKDaOydKg5ZEhs/NHKvbW6asO5ZmSGkbjCLwSnWsj4TA2PUE6PM+gOgeh3VU+SJXFeqxA9+K9ZE8z9oQXHxrk2YxCKqMM X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 25:TrlToiXBqFhI3dzp0gX7ZODrecj3jmQe7V5yZflgb1ZXeeuZvhxtb8pPX1B03ITr9RP4Kq09V8qA9/dY8TBlXIp+Jfu2gu/IMoKxwBvs2dwyNW9mzg9QJDUa43lLkjj0e9ojFgeqLDXmrqZar2BwtW1fF6Yo78jwd0n252Lr1LFL/0t4WfE+yllqaHVWBPBGsJDTbY1pl70Xb7hCaQiB587v3T73hNRXghRrXVqSumxL9Bk+E/gObAULZiVqruEKEgRNH1P66SjL773+dRtkYHInAARyxliUqSJxisthHPavAgkIGaEQPvSHkVpCUsbenPpgayjHLlHFmXURX6R88ZpCyNdzWKOAZqhF26fjkXEXNKoTO710/EOa0f52XOHcxE3np1ab48Apul2exy+ArguacHAwR/D5pSXjCAfeWphOeBvLnR2fq/MbU1OBVfzhLX4q7bj5rQhRYxQMYMxT4Qzc8uiGBbMkY/dMUIUHwlxew5Few4Pqutr6l+sSW75m9fTYACsv4YDnFl01TXSryDMFh2VpkJjbpsGlZHoj1X/8ES9WR2CaqJr6FIoaA2n7RG3E/Yd27mc99Z/bDKH7xrH9fBqiTIhFb5GFZKIQc0+mq/skbqltf/peYH+If+zjuezvxLDYr6jy8eR1PGBwmug0wWI371Rmjp90TOWYTRCTbJ677SJDz9aFHCq4GCVw6yXolAIym6nbtxqS3TzAc7g+330EG/l12h3vaKfY9VSoxPryIDQ/XlG5wW7PokO3 X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 31:8KNWnci57xM/i3EN2qe/oFs4gp++NFmaG2LuE23WyY+yiu9KX0Z4ofrKyYbsfVWy+rSywCo7pBowdGyaW/JZVB55inPzFOxdMJ/NdJqd3MWNN0QGHLtF9uJeJkIyhqnnO3lJwsKZnVzpByRxwmERCUVDAmkExqdSUheEs2fBey6HQtDPi7zVBAR3/t0S6p6aASXTp5xvotF/tUU2WotnvXRKFjyQMtCPDt+6FWUWKtk=; 20:3Be1V1ZAbIRPCXjbzHC7JsBR64sI8l98fVY+m7KDk/ZVyp+S9Op0YUvDCI4QMxdpxLHDvxVd2fpd2zGc6f658VzAs0osVVWbiEV8Cd1bae8Az3RcHyEMEJNwPSWGTdyLce+6BcfwTTIuxBrl92srdODFgEwFCbIoHZuBzqdeDr6FCZjsKy4ysBimyzIJDL0xbgkIARb30Zl1WuljVJA/oq5budMnE+jMv12C0RdOAIZJrOSVc7U6OucOnskRkHPcEZJtZgzH0KVs0jzJEwMO45dEQNfZBjOKAkJkai71DMC+4UCIAXe563e+GAI68q+awrFlT5bwUgH3LrQIaM/kR9rKfMqxflbD4CPUuscp9t6sYreRYHjUCEARFz0Ac2JChsm3C1wWRMsKCJcuFMNUQjc1SJvsX4As3OdPtNgS0kVvjVlTDZCAU5rbocbW8TJM78lGt4iKONorv5uAZDFGXZemD4//HZ2fufgifcgxzCkSgBPQJ3t4yNxea9a6ewmV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625)(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SN1PR04MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 4:w6lDf/0/PZNP1ZY5Z5FjOB75PUkvRS0EfvyJI+Kou4qiKQFPHxjMEB6V9GGGRCjJGClZ2YaZfze8u+m0W2ALAltuvZytbfBLRGSW0McPoFUMh6srov8m9xw+bTlxNjdqL/yuczJoDDL9ILsfv8nKC/xbTau9Yf1eBSw87FnFd7qBkNnu4hK4gCvZmCzdjvn1b3kiz17gSMSM3GInvYDD6Ttn4thDuxS9XwglLLUmhtfB4m0/nqsYk/4MRpWOZjqVG0KzrIRzwdg6qQGunRyeiN495t4C7zMRnHeMxqpMGwD/cwXOeKDBuivMeeQ711303NLHC0GqTRSZR3s53pBjdpdiqR0fnF45eMTy1zBGbsEi2v7I1rjgbXeoVVJYcgB4bzOq0SamqBEIH6Z92sBG7Au2wGxCFjd45Mau1Jm+lpMLlBu6/1Gb1kxzusLKpeNPgAJXNzXOokhXHZNRfOR5gljVQt6S9kTyp+3yj5jzarM= X-Forefront-PRVS: 0079056367 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(50944005)(189002)(77096005)(19580395003)(97736004)(2906002)(7846002)(19580405001)(305945005)(7736002)(5660300001)(68736007)(48376002)(66066001)(229853001)(86362001)(110136003)(50466002)(4001430100002)(5003940100001)(47776003)(81156014)(586003)(3846002)(106356001)(6116002)(107886002)(36756003)(4326007)(81166006)(105586002)(42186005)(6916009)(8676002)(189998001)(33646002)(50226002)(76176999)(2950100002)(50986999)(92566002)(101416001)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR04MB1983; H:washi.fujisawa.hgst.com; 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; SN1PR04MB1983; 23:iECuBTBILK4TBog9r6laB2YsQAtCvzJbDXoTUm88X?= =?us-ascii?Q?FqWu3beG0l8MnSIJD4ayFK7qAQ98QcR1pjdGxQAL1JDHSWBHa3GJ89zxk2v/?= =?us-ascii?Q?vdGtGcxZV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e7LXKAgUsBYXQJCIH35R2f4lbHq7bYtehXaRbYrt3LjLyYaUbwpWkPQGOtoWY1gi7mCfl6Q0nj3E5nabWjBkwzmk5F4PTq2+qrBjIrVsiWSxc9kSKzVwoNf6JVIwNRcVbxY5xi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 20:iDepBKqjAVFu1BRm0rPsydmL+w5A6IGQjNukys28fCmoXI4FjYA3UMAEfrFVx8V93kiqiICdE1T73wW9wS8SgBJsKsjPWpYlPY3i7YB7e7eumUfpHm2/nUL8/o1eynGnxp+LyX7GAICcJtB7iACF2BQht1y6PLohuzEP87X9yEBJQjVQR+GL6hM9ul8ulcrW9XHW5aQxCJgbsu5cmgO+r0aZ0r9LV+59KpjU+usQ/k+IHfGQJC9EJtloGQxCwVCe X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 08:46:39.7831 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR04MB1983 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 Add the zoned queue limit to indicate the zoning model of a block device. Defined values are 0 (BLK_ZONED_NONE) for regular block devices, 1 (BLK_ZONED_HA) for host-aware zone block devices and 2 (BLK_ZONED_HM) for host-managed zone block devices. The standards defined drive managed model is not defined here since these block devices do not provide any command for accessing zone information. Drive managed model devices will be reported as BLK_ZONED_NONE. The helper functions blk_queue_zoned_model and bdev_zoned_model return the zoned limit and the functions blk_queue_is_zoned and bdev_is_zoned return a boolean for callers to test if a block device is zoned. The zoned attribute is also exported as a string to applications via sysfs. BLK_ZONED_NONE shows as "none", BLK_ZONED_HA as "host-aware" and BLK_ZONED_HM as "host-managed". Signed-off-by: Damien Le Moal Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff Reviewed-by: Martin K. Petersen --- Documentation/ABI/testing/sysfs-block | 16 ++++++++++++ block/blk-settings.c | 1 + block/blk-sysfs.c | 18 ++++++++++++++ include/linux/blkdev.h | 47 +++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index 71d184d..75a5055 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block @@ -235,3 +235,19 @@ Description: write_same_max_bytes is 0, write same is not supported by the device. +What: /sys/block//queue/zoned +Date: September 2016 +Contact: Damien Le Moal +Description: + zoned indicates if the device is a zoned block device + and the zone model of the device if it is indeed zoned. + The possible values indicated by zoned are "none" for + regular block devices and "host-aware" or "host-managed" + for zoned block devices. The characteristics of + host-aware and host-managed zoned block devices are + described in the ZBC (Zoned Block Commands) and ZAC + (Zoned Device ATA Command Set) standards. These standards + also define the "drive-managed" zone model. However, + since drive-managed zoned block devices do not support + zone commands, they will be treated as regular block + devices and zoned will report "none". diff --git a/block/blk-settings.c b/block/blk-settings.c index f679ae1..b1d5b7f 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -107,6 +107,7 @@ void blk_set_default_limits(struct queue_limits *lim) lim->io_opt = 0; lim->misaligned = 0; lim->cluster = 1; + lim->zoned = BLK_ZONED_NONE; } EXPORT_SYMBOL(blk_set_default_limits); diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 9cc8d7c..ff9cd9c 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -257,6 +257,18 @@ QUEUE_SYSFS_BIT_FNS(random, ADD_RANDOM, 0); QUEUE_SYSFS_BIT_FNS(iostats, IO_STAT, 0); #undef QUEUE_SYSFS_BIT_FNS +static ssize_t queue_zoned_show(struct request_queue *q, char *page) +{ + switch (blk_queue_zoned_model(q)) { + case BLK_ZONED_HA: + return sprintf(page, "host-aware\n"); + case BLK_ZONED_HM: + return sprintf(page, "host-managed\n"); + default: + return sprintf(page, "none\n"); + } +} + static ssize_t queue_nomerges_show(struct request_queue *q, char *page) { return queue_var_show((blk_queue_nomerges(q) << 1) | @@ -485,6 +497,11 @@ static struct queue_sysfs_entry queue_nonrot_entry = { .store = queue_store_nonrot, }; +static struct queue_sysfs_entry queue_zoned_entry = { + .attr = {.name = "zoned", .mode = S_IRUGO }, + .show = queue_zoned_show, +}; + static struct queue_sysfs_entry queue_nomerges_entry = { .attr = {.name = "nomerges", .mode = S_IRUGO | S_IWUSR }, .show = queue_nomerges_show, @@ -546,6 +563,7 @@ static struct attribute *default_attrs[] = { &queue_discard_zeroes_data_entry.attr, &queue_write_same_max_entry.attr, &queue_nonrot_entry.attr, + &queue_zoned_entry.attr, &queue_nomerges_entry.attr, &queue_rq_affinity_entry.attr, &queue_iostats_entry.attr, diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c47c358..f19e16b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -261,6 +261,15 @@ struct blk_queue_tag { #define BLK_SCSI_MAX_CMDS (256) #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) +/* + * Zoned block device models (zoned limit). + */ +enum blk_zoned_model { + BLK_ZONED_NONE, /* Regular block device */ + BLK_ZONED_HA, /* Host-aware zoned block device */ + BLK_ZONED_HM, /* Host-managed zoned block device */ +}; + struct queue_limits { unsigned long bounce_pfn; unsigned long seg_boundary_mask; @@ -290,6 +299,7 @@ struct queue_limits { unsigned char cluster; unsigned char discard_zeroes_data; unsigned char raid_partial_stripes_expensive; + enum blk_zoned_model zoned; }; struct request_queue { @@ -627,6 +637,23 @@ static inline unsigned int blk_queue_cluster(struct request_queue *q) return q->limits.cluster; } +static inline enum blk_zoned_model +blk_queue_zoned_model(struct request_queue *q) +{ + return q->limits.zoned; +} + +static inline bool blk_queue_is_zoned(struct request_queue *q) +{ + switch (blk_queue_zoned_model(q)) { + case BLK_ZONED_HA: + case BLK_ZONED_HM: + return true; + default: + return false; + } +} + /* * We regard a request as sync, if either a read or a sync write */ @@ -1354,6 +1381,26 @@ static inline unsigned int bdev_write_same(struct block_device *bdev) return 0; } +static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (q) + return blk_queue_zoned_model(q); + + return BLK_ZONED_NONE; +} + +static inline bool bdev_is_zoned(struct block_device *bdev) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (q) + return blk_queue_is_zoned(q); + + return false; +} + static inline int queue_dma_alignment(struct request_queue *q) { return q ? q->dma_alignment : 511;