From patchwork Wed Sep 28 08:45: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: 9353341 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 AB24F6086A for ; Wed, 28 Sep 2016 08:46:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B71D2942F for ; Wed, 28 Sep 2016 08:46:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FDB329450; Wed, 28 Sep 2016 08:46:58 +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 4CEAE29451 for ; Wed, 28 Sep 2016 08:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262AbcI1Iqx (ORCPT ); Wed, 28 Sep 2016 04:46:53 -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 S1752228AbcI1Iqq (ORCPT ); Wed, 28 Sep 2016 04:46:46 -0400 X-IronPort-AV: E=Sophos;i="5.30,409,1470672000"; d="scan'208";a="18827628" Received: from mail-bn3nam01lp0183.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.183]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 16:46:46 +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=cKsVRSKqk6tDZdULZsQH+S/ArEmofWmeqgkWipeB8cw=; b=DMvIGNIdZ702UGHWiLUNZykaCVOh7FxiWLEXxLxR5OuNSDnE1jVPUp6QruEmV1eVO743PQQGPYEc3Tlx+6pLQyisf2mMBtfJd4jpidwlKmFb8dYm5/AclUOr8KZpZx5zQj3v7ZxgsxZIgasgs0k9asrUhjAUKpNyhId69OnxQuY= 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:42 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v4 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Wed, 28 Sep 2016 17:45:34 +0900 Message-ID: <1475052339-10202-3-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: e25349d1-0439-41d3-212b-08d3e77bf92a X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 2:nKWoFqfay8p0RMErFprKhVqw0ov6zgUqn9do26f9FdrkhwlEU4v5Mz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H8i0iCa0ffyWqOOf5dfXiHWngrf7hrdWKW/aDmnm45VzVRStIODzPP6dxghBMvvlYp7n1Fjq6Tc+nIxh+Oe/3Fvq/x0Wxk+56WQzqwFFRpfL5Z1ZxYR+YYOhwuiiLX57Ej9UcKS3Oak5ly8PeVFLNIAaxPICZE87AH7e4lJPLb9gtom9bfRwviZFVBAFmHPhJrxWce32AJqt5i711aGFnCzdTv88sgo+u2PYegPJcRmEIkbc16G3lKca7dqInxpmN9OwB3QHrnnagtbyz0DUKFQ/jWiAhyJuBdsYzNlzQultsFgk/4jKGFrqS/56uPzlyxpbVyc5BdfVrRLBAQwSlZC4M6l2gjzb4z53oulwx6XXTbZWO4Eodtv8qfbt8omFB4qECC4JIVbL2WDQ/Iikjy83Q9/V8Wi2sdsNMYzlitoDJge4J/ADr+sz0+jJBUgK7W00r3InRLBJmBRiqLv2 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)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SN1PR04MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 4:UG6a4Ag+t0EBnWD7caJV3yVePNfnQow+GQ+kZ5eiJVcHsqJGPPnCEgv8cFqH9XKCLL53IYQ/GB4bxWT/wiy6z+RhuQCxynHdByj+Fw6bOroPn9besxtYmxJ3SlLCzy22zKOYo/bzhNLNJpazCeOud7AWjOB7yWKOYr+kqdGZqdpqzYgg31V82k2YSbHDYHxhSRhkdtsBo8yXYUZObsHwakCCejneFJWg8YxIMfbmZNRiK8WGaFIY9x4uYyeFcsfMKTmoX7t3poRjdyDCar2KP42XzSDpMNXWqcgXS1DgdG8s1lQTMiDdTI4N1ssqVkjvn+U/UIz3Dzz90JFMAriT3EDyx+5daQcGPgcorAQkW7QssLPUM8tettzxaXCdYAyB08Csd4pnrArmChqDqPO5eiwwhTS47Ihny7WhxYE1C2mcLV3BV7XIewkKlKE9ICxnO1rTkKUKkbQeUQ03WWUb4Q== 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:MUvGpLk6+cwK6MZ39a4GWxLNRSx+XQeE99ZuRQfSR?= =?us-ascii?Q?s7qhZPbUro3849gw2h00HrGaAon7OWtJ0iFWbYAq5ULQpQvF9cjjk3c6ohcW?= =?us-ascii?Q?YeSqgdpZ2GMJvm9c8/Gpv6I6hAAKeBkkyQpkfbqJvvrCABlnHVG2qlc1eraz?= =?us-ascii?Q?msO1purxsuSBv5in0wILUoGGHN72EL8KpKtqXtmQoO+YYrr0ThFFdV5bYu3o?= =?us-ascii?Q?0h9AnfIqdRfBwrMYm2rRoeP//BTIZQ/dFLcIC/mrXvI+njpqlyimKCtWuHMB?= =?us-ascii?Q?A8GmH3eDBcn5Uj2hUSw/h7fKYx/d5+0zweJNwTVg/n1qXERPr2jDfJZrkB5V?= =?us-ascii?Q?oehZpxfYbnrF1lZKcFsmk2QgxtMcOOCi2wsi02A3JS0WjCmb9X5owVO5xgM3?= =?us-ascii?Q?DwGZNX7VDJIPh1xLAA+jB65iVTOmsScVaLo/wpEUNyfGuL+MiWCG02eWvltB?= =?us-ascii?Q?4b7ZCHSYSk4gc/VVEBH138gAFkCgaNKEnQ5MfWI+DylIlg7svcOojaBO2CNC?= =?us-ascii?Q?Hhp4PlouEfXh8QoIR320hQcx68FBVjrPhHUsb0UuAugo5QaeSG4zAsmr2KUY?= =?us-ascii?Q?g6VicWb+eOMqAbiWZkMA//ptQKM+KfkPRZSnG72ftuRo5M/VhgsX29WjkSaQ?= =?us-ascii?Q?SrmthjgAJIVsCepqb8AM+9MMmv5M8mxhx6PtcxjEqjQQeFTa27G+k6ZjS/Dr?= =?us-ascii?Q?qXlSFamzopBsiIBs6rAeh5+s5OFnglbtEEpKPv8OxBp8lmhTJwpkZlElWIXS?= =?us-ascii?Q?0DskGk9fuVERU6fLgNTur3CHWKCJO9Y3/Kf8YemoMvYR9H7ij3kyQIRKetPx?= =?us-ascii?Q?dOVg+GinmWg4GoinUBcdTiZDAwPfgHi1OGmOef660USQjGAGUnj8h8JhrNNN?= =?us-ascii?Q?zfqfNPG4i17FbEi0nTjqRcK3DXCk3PRJBexirwdTslRbBGn6acSt39UrjESx?= =?us-ascii?Q?gOIU3p5L1YV8q4G9Dtz43sFQM7yNG+mkdxuuNnqSCikZCKemzxiJvGldTBWK?= =?us-ascii?Q?J0qxTr8Q1DjgPzOxsAklHHp4MJuiADd2CLJzudroH0v8dZTbFZ3mhUT9NqJB?= =?us-ascii?Q?Eaxr6Di5on2voR00pOc6BT+xLW9EF9KVoXc6vuHSphB3MdRhCojD/nu1W12o?= =?us-ascii?Q?rcq3B2rV8gQvVfgSohIFZAIc+pLejR+Knpm2WBbirI3GaE/wvVHjg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 6:/05Jm2Aj8lMmCi4vzR/1OzlV20NZPbw3UfRYZmhHVuh552nOTqtGg9rm6twrOt8SxBdApFo7CTZNJdyMz8cs46fJSLYuaH4GIv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6rwt4nSThN1d27pDWp3rsPJ+b0ugPVlQXWgn/ACopoUjIWMzT+0B6kKrNmfn1ylyhJeAAnelQRYh5mLDQ7n+T25NIR3rJDOs2+ll X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 08:46:42.0460 (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: Shaun Tancheff Tested-by: Shaun Tancheff Reviewed-by: Martin K. Petersen --- 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,