From patchwork Fri Sep 30 04:11:34 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: 9357627 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 1DC226086A for ; Fri, 30 Sep 2016 04:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26C6D29D9D for ; Fri, 30 Sep 2016 04:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1645429DBF; Fri, 30 Sep 2016 04:12:04 +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 6444429DA0 for ; Fri, 30 Sep 2016 04:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751260AbcI3EMB (ORCPT ); Fri, 30 Sep 2016 00:12:01 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:60492 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbcI3EL7 (ORCPT ); Fri, 30 Sep 2016 00:11:59 -0400 X-IronPort-AV: E=Sophos;i="5.31,418,1473091200"; d="scan'208";a="22622613" Received: from mail-co1nam03lp0024.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.24]) by ob1.hgst.iphmx.com with ESMTP; 30 Sep 2016 12:11:59 +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=1PEGwvd1KoIrEgg02umN5oh/kWfzyLpHLZ0HqKGvFe0=; b=Y1NDyXapyphJZAdZT8oKJ01+Sd2cU5VqNi6+/uehpnb4mEHHwzDX846TAkurNIJUeQJ7HJT7bemFL/NKFUUiJpS3uM030z1uAPSXiY40lEwbRgtoVOazv2zloPR93N01XBmnra3RdUzE3cdBsCrRU/we48L7Ox3Tj7PoHNdy67w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by CY1PR04MB1979.namprd04.prod.outlook.com (10.166.191.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Fri, 30 Sep 2016 04:11:54 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v5 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Fri, 30 Sep 2016 13:11:34 +0900 Message-ID: <1475208699-27310-3-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475208699-27310-1-git-send-email-damien.lemoal@hgst.com> References: <1475208699-27310-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: BY2PR12CA0020.namprd12.prod.outlook.com (10.160.121.30) To CY1PR04MB1979.namprd04.prod.outlook.com (10.166.191.15) X-MS-Office365-Filtering-Correlation-Id: d7549dbd-bc53-4539-7643-08d3e8e7ea73 X-Microsoft-Exchange-Diagnostics: 1; CY1PR04MB1979; 2:cYKL/zYlZE2HYBvdm8c4F1Q6Tr8vTA1CCr6xAkGK1k9L7/C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cv3UlTGbAB2ftlkSSQ8NQkj0D+zQZsoyqFwEer2xL3cS+2ohFQY+mqqhUpgJjWtoL8rea7T8VxK/UcBHAjNSSOicSa848UOPd5Y4ZIksJnYqjVmbkRhYcQa7p1RiRyXvEgFkcHh6rln6bnkvJjOF/va2jpKNrkk3lvGdZF95ZObjDq0BYxtdyphUM5qjntUlMDINeC5ReIDJvhIS2kQAq0fuGKyPmuLDZeS3e9aOfRf4eHL74ZIXMZAgUlRqN9EAdHftmIW0kfT+WB03MRRtMSvlwT87aHjow7jk2XSaQP1q6/gcvZo/Y7/P+gTzzIJtqQy3i7TV+fREckxaG3HWfwgtADyYtQ4bA5YfsJd+jwwGXMWRvTcFFLtP1FmLTSjM0Jl+k0irJxQLpeRDFIA2aPybB2Nwc2VhC0sVIcgVsQaP5FX0kax/trLyp68rKKODTwha/M7/2yani1TtYpdlOsz16nnH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR04MB1979; BCL:0; PCL:0; RULEID:; SRVR:CY1PR04MB1979; X-Microsoft-Exchange-Diagnostics: 1; CY1PR04MB1979; 4:AUw5G87ZNHOyLngYZdoFc79F5MKHzzR73Y9Sh4bEhONm9XtJD7jiF0eEJn+QoQOgY8Q5LLRDwvbL/mgRfb7uwE2o0IruoAmM/9eWHVw+tpx08fb+CmY/8IkiVwuRlWkkW8EneaN4kY9Y5nXjACL0TWov1O/sv4bCw3fvy/gSTZnvwXtJHcpuMAJFCPCxYwhA/mq7Bx0najXkUHDc7QWZ6YGKTr3fDkH6J70FwCWEBpCRumMrDLUN8EpjVcgW1816yVVCSS+Z1zmtIezd/Jijj9haQKtW7QKvn5HvV/tDDIrCicXmosA3wsvn6GksoLt0WkXbKJSURoBKaSRcw3YjwZ7mXKNvlBa2X6kKIyrgSk4ih4XyNZ81Av46HB/f792Q9sK2CGZr25MTgBc+88I0TTlxipvykjL9T7OS8ujEm6n3p6wmKdWKmPzl4TJOfa6cdO+2y+OQHKY/xxB8KJQCZS7bQx7o/2Ywqs++jp+p8f8= X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(50944005)(199003)(8676002)(42186005)(2950100002)(81156014)(6916009)(6666003)(81166006)(5003940100001)(47776003)(66066001)(229853001)(106356001)(7846002)(105586002)(305945005)(2906002)(36756003)(189998001)(7736002)(5660300001)(76176999)(50986999)(97736004)(586003)(4326007)(3846002)(107886002)(50226002)(33646002)(50466002)(86362001)(4001430100002)(68736007)(77096005)(110136003)(101416001)(19580395003)(92566002)(19580405001)(48376002)(6116002)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR04MB1979; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY1PR04MB1979; 23:T5bh4BAjmdxWtWuu64w0pO1dH3scCZhCYB6/yRiEw?= =?us-ascii?Q?FGPKxum3O+Ysw7mMmoh+mtyWMCrk+VIJG0rSUMY8ybBdDgvgrQnOMkTDe7QS?= =?us-ascii?Q?IBUeOHSQOMrNF5l7wr2MZHZVHQH/9I5Ox/pnmr5jLo9vhN4Y2XP8LjQNANyG?= =?us-ascii?Q?3rsXHBTHPBSlzTdVJCjP3yC/qX/FGklxfNDE8beHwznMsQS5QnqvQQJlGQpm?= =?us-ascii?Q?As6vYlNFT/vTgmX9XAaOd3vmgg491ttnB2WJ8u1rjPEPBnolwRKXtL2ZGhiW?= =?us-ascii?Q?klLhjK34Ri0UbkdZ2FrOBOLmwoOTnB9nR8ymAYH+w0//SmFVc2vB6WB29sEi?= =?us-ascii?Q?0gq2FR8J+7BtU99k33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bjShuYmP/fiAsRxQQUv9g7sSiIaKJbKZOGXbhTf8vPQpwPVpS0/ZV+FWVU6qouMkMRw0CRnsVKyosMF9CIOnMQ+OzZLbFxMYIBYivNNparb4FvIzPrEYmmLvDWbXm1qZQsj0cRyNP9GqT5RqvSZ+4/pxrw6Ue7Nbac X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 04:11:54.2924 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR04MB1979 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: Hannes Reinecke The queue limits already have a 'chunk_sectors' setting, so we should be presenting it via sysfs. Signed-off-by: Hannes Reinecke [Damien: Updated Documentation/ABI/testing/sysfs-block] Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- Documentation/ABI/testing/sysfs-block | 13 +++++++++++++ block/blk-sysfs.c | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index 75a5055..ee2d5cd 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block @@ -251,3 +251,16 @@ Description: since drive-managed zoned block devices do not support zone commands, they will be treated as regular block devices and zoned will report "none". + +What: /sys/block//queue/chunk_sectors +Date: September 2016 +Contact: Hannes Reinecke +Description: + chunk_sectors has different meaning depending on the type + of the disk. For a RAID device (dm-raid), chunk_sectors + indicates the size in 512B sectors of the RAID volume + stripe segment. For a zoned block device, either + host-aware or host-managed, chunk_sectors indicates the + size of 512B sectors of the zones of the device, with + the eventual exception of the last zone of the device + which may be smaller. diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index ff9cd9c..488c2e2 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -130,6 +130,11 @@ static ssize_t queue_physical_block_size_show(struct request_queue *q, char *pag return queue_var_show(queue_physical_block_size(q), page); } +static ssize_t queue_chunk_sectors_show(struct request_queue *q, char *page) +{ + return queue_var_show(q->limits.chunk_sectors, page); +} + static ssize_t queue_io_min_show(struct request_queue *q, char *page) { return queue_var_show(queue_io_min(q), page); @@ -455,6 +460,11 @@ static struct queue_sysfs_entry queue_physical_block_size_entry = { .show = queue_physical_block_size_show, }; +static struct queue_sysfs_entry queue_chunk_sectors_entry = { + .attr = {.name = "chunk_sectors", .mode = S_IRUGO }, + .show = queue_chunk_sectors_show, +}; + static struct queue_sysfs_entry queue_io_min_entry = { .attr = {.name = "minimum_io_size", .mode = S_IRUGO }, .show = queue_io_min_show, @@ -555,6 +565,7 @@ static struct attribute *default_attrs[] = { &queue_hw_sector_size_entry.attr, &queue_logical_block_size_entry.attr, &queue_physical_block_size_entry.attr, + &queue_chunk_sectors_entry.attr, &queue_io_min_entry.attr, &queue_io_opt_entry.attr, &queue_discard_granularity_entry.attr,