From patchwork Tue Oct 18 06:40:30 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: 9381363 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 89CE960487 for ; Tue, 18 Oct 2016 06:41:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 780B928C99 for ; Tue, 18 Oct 2016 06:41:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C600293D9; Tue, 18 Oct 2016 06:41:42 +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 A4EAE28C99 for ; Tue, 18 Oct 2016 06:41:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757888AbcJRGll (ORCPT ); Tue, 18 Oct 2016 02:41:41 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:6972 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757804AbcJRGlh (ORCPT ); Tue, 18 Oct 2016 02:41:37 -0400 X-IronPort-AV: E=Sophos;i="5.31,508,1473091200"; d="scan'";a="22753051" Received: from mail-dm3nam03lp0021.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([207.46.163.21]) by ob1.hgst.iphmx.com with ESMTP; 18 Oct 2016 14:41:36 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cUfB1lXrnKO1eXla52+HBbo1oVBsEJIfl5AAnu10u/Y=; b=mG66y1w3XbWJ+uN5UZUpOcDkicKutp6eFe+ohSExLM6aZvkCGsIwWUy+FM0HX2J0rBcxdJpYKDyezVCC1nzpfUjs1x4bRVGevtgkqYV1ZZBj0NBQV2FQSDaa5gjtNL0OtzcQ4MNAzlZk7HJUQPDaKauM4HUp9p12XFnrSwp4npc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by SN1PR04MB1982.namprd04.prod.outlook.com (10.166.69.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Tue, 18 Oct 2016 06:41:32 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v8 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Tue, 18 Oct 2016 15:40:30 +0900 Message-ID: <1476772835-18541-3-git-send-email-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476772835-18541-1-git-send-email-damien.lemoal@wdc.com> References: <1476772835-18541-1-git-send-email-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CO2PR06CA014.namprd06.prod.outlook.com (10.141.242.14) To SN1PR04MB1982.namprd04.prod.outlook.com (10.166.69.142) X-MS-Office365-Filtering-Correlation-Id: adc94cfc-8877-49ff-1a3c-08d3f721cd3c X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1982; 2:HKd6G8EOIWVPM4zAlJ5ejKnzkh72h9P475WXbhz1UywoIZIbnq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D0ZylPj5Ev5NvPKUOwiwTHYjMJCm1slvEAo/YqXXahO+t2Y86wHrEFWklpG2GNa38Ke8AMDUEywRFAqLn+ngV/ubc7M X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1982; 31:5bLWMMzNSAB0VjsLblDXahTiCVtfFL99eWTLyPuV+wt/TP55OiodvHiBjPku722gMKnFGne50P0UMzScVhOs64JeAI5zgpXgiNWpsP4YfyYwm9sFpTotUj50d0+E/5bI/zoC1mLLj2b5tJhu0byBxeEIKMbaWs68Wo/gtD68FfJ3Rpu8YDj8a5wSfX54xb7ExZEmzjrGUCm+s4W+zJ0rJxzQYzg6uCcLMFrOJeoZext9H1yzj/HgnBmz9zb2NISHjeE5+V/+uR0Nvaw3Jjza8A==; 20:6n7sj3ugAoYs4epZBsW1dHJVSoRE62U/obtVwcvGISBkTUUwz0e5nM4BB5lWqd1JSQKzvYJkkFWmPb2l0AKfWkPrdmQE6MT8+Tt4FM9rs/7UH2mCDhTRURvmyoqcnYv3r+9bxV1Tcz0vs3ou9Jxy8IGl0ZudZuJmuPBKpG9G28ot0QYUXmst1aO5jH7kSn9LQsrOOzK9yezISuWMQh8Owcf+lkVTR3LaNDuum45KPBKqwDenamkDrVuX19DiIuFFDcmMNQAJ1kJzgchSI/jLzQ/SDOip2O/DKR+DX9RLFZY1MCxAQpU7Q9eh1Zh0OuI49faxmhJULTqJdIslPPJYN0P2IAqS8ZjPJ+zfmeGOnoBkqgMtYjJAINt/yOxYAYPFnW5lx8521BGjpVIUzdbHK43OAoPdJ7Zwgv3PB/L2QZ3Zu4J5uo0nKCjj/6A/RjYIDFWx+xxY10JSHqVpzAPQcA8U+HtLNjGGo5PV9aJq4zESbA6WmuheS3kv3j7FIbr9 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)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:SN1PR04MB1982; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1982; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1982; 4:AfXAOup51rXHWc1xUhpJaat9E3MV2PlYP17W8fQZXl/e+9eAn7heKKR4vILnTY/EXqydK3B7Tb/ozIFsO8uItwX8AB+pZYfFJPb2O+X+eMOYbmUzR/WlFSWwf4xm2ssHFux3UeoK9A9JWHx1TDf73y9d4hCIDP4RdoFFlF6ht8EU/ZayTaf3g9T8wZQC34aJOpg0hcVmP5hxTVPNMjiNhbTvIrm+95qIJj/kAQ0hBzSYQ/rja9D/r9ORvMtT5CD3GaaaW1eATC3DR/RXuRHjVSX05GPdaorpTpO3y/ha7LJtiBHbmEntLSV89MrX2KTEsrNM8UB0LckC1HTc992vpHBKsQ1qjRF+x/iApKWB/7J8gx6uGdAjuyjK+wos6AtF3xQ5BoyjIqw2jjf9nCM0DAy0hCaiZQyDerKbSpmQiHMKGHZRPIfvHwtgrt0fut+ppWhxLoLdxlv2Ik3rkeoKGb7yx/jpCilHW6ic6cIyAPKrZpkDBDo61xERquc7KDC9 X-Forefront-PRVS: 00997889E7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(50944005)(199003)(81166006)(81156014)(97736004)(3846002)(586003)(19580395003)(19580405001)(105586002)(4326007)(6116002)(68736007)(42186005)(106356001)(50226002)(2906002)(8676002)(33646002)(2950100002)(66066001)(47776003)(189998001)(7736002)(5003940100001)(7846002)(5660300001)(101416001)(229853001)(6916009)(110136003)(50986999)(36756003)(76176999)(86362001)(48376002)(50466002)(92566002)(305945005)(107886002)(4001430100002)(77096005)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR04MB1982; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us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: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1982; 7:Y+2PbPR29i5DjNfyfC4ENlo5m3ugjVgYeADFdtK9P8sX/MeXT1OQs+BZj+VOxwfxiE4KER5z4tndOgkeiTiPahDt0QOtSG98w0YsuthP1wuhK37SKZDMWK2NnwLvjv064o2rniSSsBscTdxZRd6OmNfOSBL5Uyz+V89sCtmwN13o1i/JeG9yDe+n5sPAfrpW+A/wG2OVwpeTgrfkHemDHT+5X1tcKnWr/p51Ys1g6j9jViaPa9DEF9cwwdIBRfOGNX2sHfKIdaVg77Q2Q2vfB+qnzaCiFnF7ebvWkJ7Bs41Bd+urhraxvKbODJxl9H8bxcdFbM0+/SqBH1QCSnGUJ2WVeFuoIe8ddAV0iWhT1vs=; 20:3bmkMgHTn7QGxdu2DNg7w7BFzOsA0XRX4YExROpNKEqy1kQzcGDZtmsXuElGj0fLl/Uy5h5Trx9rd1ohkypZS6R5qV7j9MZfB6trYJuhWIKccmhz5ff3Y4aaZcmMv1UHFjQfzz8Wi+t9Dyopt3mkUx4OJIcg3QTbh1ATlLNK+DMdVamCBc/KIKoZzmBXCbYgHaOZ5xFw+ytBxi2Veu/IeOQMH8wwyV2uPjH7BtGEkO1Bgb5VHZs5PrqpZ6pMbM4l X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2016 06:41:32.2683 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR04MB1982 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,