From patchwork Thu Oct 6 01:04:47 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: 9363583 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 15E3C6075E for ; Thu, 6 Oct 2016 01:07:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0937228D71 for ; Thu, 6 Oct 2016 01:07:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1DFA28DAC; Thu, 6 Oct 2016 01:07:02 +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 2EEDD28D71 for ; Thu, 6 Oct 2016 01:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754303AbcJFBHA (ORCPT ); Wed, 5 Oct 2016 21:07:00 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:64242 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbcJFBG6 (ORCPT ); Wed, 5 Oct 2016 21:06:58 -0400 X-IronPort-AV: E=Sophos;i="5.31,451,1473091200"; d="scan'208";a="20799446" Received: from mail-sn1nam02lp0019.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.19]) by ob1.hgst.iphmx.com with ESMTP; 06 Oct 2016 09:05:12 +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=cUfB1lXrnKO1eXla52+HBbo1oVBsEJIfl5AAnu10u/Y=; b=ZbF2sdbmH82/NhgoOq1x8sbX/ePns03mVLFIdt/7U9/X47ahnXK/JNIKB+YhHT+O2X8cFmONY1uqJD5FrWqtqg7xmYWgL5EwwuOC2qH+VnrvQQZrnAnHC7yVxJZmy7C7zX8/M1Yy1nT5dWCnxHivPodl+mWooBhX7cVcO8tANPw= 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; Thu, 6 Oct 2016 01:05:09 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v7 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Thu, 6 Oct 2016 10:04:47 +0900 Message-ID: <1475715892-18856-3-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475715892-18856-1-git-send-email-damien.lemoal@hgst.com> References: <1475715892-18856-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: SN1PR17CA0065.namprd17.prod.outlook.com (10.163.3.161) To SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) X-MS-Office365-Filtering-Correlation-Id: a23a2bbe-783b-4549-6d96-08d3ed84d261 X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 2:voc2O0cDiDwjXSeNzC5Q6sufMxAX7XiIHiql3H9QwJZ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mUUrOrP7wb7l/lvmwV3vp+S3lv2yNGh3mynZKMO0cmy0s5yW1A/vt5hOUCvL+cG+v3wiZ2Wk2k4c0MshUfStdaBj/PIKQmLXEZrHjqQEJtNsfNhGNwWzQpFDLZ6tb433yYil6myIXeZP5JCudZtE0xPLjEN9N5P8CP5tzhkpuvzlk+wEiVx99MTnR8dv8EmhX+VHa3Mkpq/gSNk+YNajm696HpLMSZw96E0O2/6FZMolOVa5GJYdEuG2Hgx7E6sviaUOwdGuRv8jynkZsqDYa2lUpruOoh61DgwZm2+6PndYPokXDyO98nuUGWdRTZ6h6a6HqC9gRV769ROwrdpz4yH3wLrxhTi3qXeMtXc7PE/sGZycfdV/Eix1pWabj1rYHPbOt0+aS5ktVontyr303JfwjmSiCD4fzaEP3sXzFZMDq9NHPdRZg5ZpBMTReTyKmqrRuCBgYJVsyPLtzO8qB74sMI4SanHVXAG 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:SN1PR04MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 4:6rxobttS2NeIBSxDun1LUq0Qq530YU2m1h1rzfkvhi+Vx0vTrBD0/ykpuG2DQsNo24WIDbTfJGEJiXduTbULArTceUPc0P/VE48c2V8EAR0uUZgrAyN/kyOnFCfkDvQ+jhPDfnyXwJjW2dYz6uV7GfRI2su1exqxI0/4zANoAfSetQ/91mwYCKr2BruF1kRtAUPa/p4Yc7CSU2ClKupJ0gc4P00dKyt3D98tXW6tODoUyv7fDU7DrG5phw1HUgyHc8eGms524KaZ9x+lTI5kNsW4Uz4a262vPlCO6yNTH7UeOR23bdTeiiNr5HWBZDUnVEM0cvnoIiO/n+FK1I5S0ychV/yPnUlE/eRBbVbze7MXKzvUapbqyzOrvQwP2Tg9q01VrFOkSxaqX/fx+qts7HmL0NrT175oPd4A21RyZQrsw3x4GjqknIjA5RXVBc529s6M0GgydjEpDov7CD0tnM3dNRmLblAH4EBb+//nWHM= X-Forefront-PRVS: 00872B689F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(50944005)(92566002)(2950100002)(19580395003)(19580405001)(6916009)(97736004)(4001430100002)(305945005)(6666003)(7736002)(7846002)(6116002)(3846002)(586003)(229853001)(189998001)(66066001)(107886002)(5660300001)(33646002)(110136003)(47776003)(86362001)(48376002)(2906002)(76176999)(68736007)(4326007)(5003940100001)(50466002)(42186005)(105586002)(106356001)(77096005)(36756003)(81156014)(81166006)(101416001)(50226002)(50986999)(8676002)(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:dkxYEQBvmQM/NnWTYr/TiwCG6ZMzfA/1mGpCNEhre?= =?us-ascii?Q?HoijjP6z8wpCyN91xg1qHX0ocp7mbJD8C2V44bK8/3CgfUjtsqNeRnSia5re?= =?us-ascii?Q?5Beabkh7Pww/TDsB5hyIo4cnV3Lxg+ywQuEq13+QIGaVe8nF1FMIkB2ijW7K?= =?us-ascii?Q?5pukXDfQ+SfTrLJfZSTR9WMQ/xDAtCUayBka1Kr6cBdk/SP9weeT0Bqv+0F3?= =?us-ascii?Q?dVW4LiJxYMqGtJ0qO11e50BWpnEGFD1Z4I7w+WN8RRPkUioU5EzLOdYOVemm?= =?us-ascii?Q?uYIL+p905BxOAcgcUEalHe847Kn6rFSxcF6/py5Oq+8DdVyJnFuvlqCaeIbb?= =?us-ascii?Q?RVx1LNF/4Qerq2Wp/Wn3JZ3T9PX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DdeawvjjRVNd50crz1hxBsXR7MugdZ75evzb0Q5A8IcOhodNItqZhcKodAokA5vGd6w6kvmpFFDZCLzgq8K+p/s9TNQRQSOn/WhaCICSNU+TSqNqknX0MhZ3QlpkMjRkCOiOM4Y9oDRne5E78WZ+uMxKiwV/oLyigWMDUHIGOUItkFjCliaRVw+2N1LivCCcw5Zh3tdqrIysqKGcA/LbNtv3fzOKwjcF9cyBnHtmMgwa8UYJ0M6V4RgAan3wkemuhtgy+b0xgKMgfyXsOlAVUBan52+6yBFdFqrInhWgo2Eg==; 5:RFZIpCJzbeftOvnS2cJ0xx1KeIYIFgUW5zv/JpqMvQlhCT4j1GSHUvePuUkJpTUHsoz8mewkum3lBgMDg3JOKkckmcg3DKdFNgTidyNUnYXJl0tvesjMhTchPcZAb864JmlH4u+IsgMHtbNaNyR2dg==; 24:If3ppcExhkvl537dQX73dPAtIVdQJ8xcNsOBF86u4ONIle3VCpleIlYCA1Wc2jnGeZADfEQrUtFKXJ08dNyy8oOPG1FE5DH0foTFIL/Lmao=; 7:a5Hdn+mn2RJbmz/RFnMxoVH6DDdc6+GIN+z3pedt5AUjR077bd2q4EOupRSddTlg8xv7X8M8cV9E2W/zIsEFfblcPCLyRK4Ht5oag1HEda5Cl1twOGZJlTcY3Y5eth7wgzDxPIuFM/dlHSTDr16lysXX4e5cE61awfoAjiXuLOyEetVbL3LqaXi70RS2IrKojPhWiJA+lbGth3fiMjGMw7EFN+xo8rh2YFyb2KzyBwSG6mutNuLrIhc0xRhlU39FxuPf17rUNALNtr4yL+2IsaXDotYc+drWvBFMwf1qlODDI8fe7mnOjvIVZcWTpePZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 20:gwoJGX4lalgzoi5O4soALfYasMNUys6vSOvRIEZf/bxw+uvmUWZYM/1916LM/kfAM6D9IQkL07gz4Cx76cheF+zOo/qL3pK5Jjk7mZyCwHMcmtwNYibkqbe+NyIaJHxmc7sH1jUVbR3gGnB6Rr4Dm28K9R11NaK7FDRVv9ca8i5XkzfZbPoZnC2EoquZ0x2ye1P3zArgAAtDY4BPo8jRbc3j7zxSMfd6LbsFT52NCnRkLI6DTy9P5gC9+8oFlDCv X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2016 01:05:09.6867 (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 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,