Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2049121ybh; Tue, 14 Jul 2020 14:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWq7iFVXW9V3zhtle100q9YHdLDhKHxOBCsIDuZGnhu2hHnKpSD20bXmEkngRAqnVCEdGK X-Received: by 2002:a17:906:a892:: with SMTP id ha18mr6533280ejb.462.1594761631941; Tue, 14 Jul 2020 14:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594761631; cv=none; d=google.com; s=arc-20160816; b=Y0/o3WuMyCQ3sN1JjVXZnTNUVvjRNsnwerR34VlUdgtJMO/rle30MDK5Wg6vtlXn9o oPNhECghyBABDowR3rReed6EuQbgavfVN3RND7UdtiuABGx0dneFfjsYLE1NlU0Kx8Ap YEh9m9RzRTkw7WCwouf/0BLeWf9KCSexp5pykBNEaIad1B2+y9HsvFBUOXxb9LHhJpmy onHHEVuM2FauJuTLCj3YjTyDkC3SZZHtJ2ldqvWRAHbxXpgrtImpaIm5o9FhzL3A9Q3n t0MlAWkhDGngnNTKPEK0mMEAaenaDLtXHpy1q00l4pRbPMpJlU684s9ZAkroxe3bj3KF uUDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=khvHTHHZisiUFKQy6EPq7fIC6yOihDpxvX94t2Tp2oQ=; b=mrELpHlGCnGe8KaHQm8hWJRA6FjMdhdXj9SSR3jHKueaJNIlLv0kBcfGDrjCn5ck9n Fa3AgN7PYxjrjv7sMGZA2zVF5t0sUO0QFOK1x2GQ72Bagw3w8QOUy8VyVWaNqe0cOTMU m2nsaIgKa8nfE35jTdODmFmsvWRwoDXrL0dmUOgi5ONleP7dCSbCF7B2TaJ7YJ6WExXC 5+bksP8OrlEs9N/4SkUMcCY/HDWjRjjMHrxqmGBs2BD8FIFq8u++Tjvo+kZM3MMgR6Ru 5E06lrpt7yYg5z7MQGLG7rWkDRTHOds34AjoISGVHDmFtIeM0pbwRLZi5ONQqPY8sQ0g BDfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=kVVHus2P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si11602931ejq.719.2020.07.14.14.20.07; Tue, 14 Jul 2020 14:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=kVVHus2P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbgGNVSh (ORCPT + 99 others); Tue, 14 Jul 2020 17:18:37 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:20892 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbgGNVSh (ORCPT ); Tue, 14 Jul 2020 17:18:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1594761517; x=1626297517; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Eii7FmfTiwjXtaWeM5VI3cqCVXCyz8WbJm0iTlMDWJs=; b=kVVHus2PHjq3i+ziCcrND1PXldELov17MAses7XbS5ikQM1FDMPUReQp DdFlEdc8VJ2JA6+Cm3FTYtd0N+p9YlzHdCmZiD3I2asKdAoLYwIebJcgq yOX4DkP25MRDEvfLw+c00AcX/kAHM3Y45heqTmYQTv6zXc2nOL8QTasNB 1owWw5wpNoNmfEHO+uArk88sGTvWuGxQtBY77GT1b1sVdh9jT50zjUj8N +1iKN1sDq1606AR7XdMwyYk1et1Y/3kerp7YDqAyCxnVYxaV4h8p3I+z3 zIjwQ/LnWLjTWZzPW3VR4vM9ngT8Rd7QjKt+GJO4/qRZs5lby7TLVHxPF A==; IronPort-SDR: vIkvKDXrQogmZl1IHB4mazvAyLWTQxPlvpOhWHJHojCsDp4S5gnBvH6gLNEP5rsjxgLizVeutd 8K8kaRYrQQqUECpt+cxcgiXYX/Sib/CAkXaG1z/jC1A8VqkC2d71XXBtUfYbKv47zZJhC/9Z2n lhG0860Rt1F28gH5WtA1ClrMCU5dYmJORnZe3D6ws5TRaw+UYUa62v6dKm2203xF1NNj8ErrYT xtJzk7XrQPXchZ07AYOEnDyVxbzDedyNGoIOQDtpENdGynJweHwbbdVmEUEFjczZZZUZz0X7PK iGw= X-IronPort-AV: E=Sophos;i="5.75,352,1589212800"; d="scan'208";a="251722322" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Jul 2020 05:18:36 +0800 IronPort-SDR: yxCyiQCl6J9TlnWkcAbuSiL9Zeudg4ZC2C+rIlriLM9PmnrYVB9/rsUA3yW/3UI3vENUOQCQrm MV+iIri0AQphI8KBy2Eg1wx1PrlIFzNg8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 14:07:02 -0700 IronPort-SDR: k7z3BG/rBj8iFCvPyvk0k3PKbnvggxnH2BwR5yWdE3n5oHKB7mt35lSX0qKzIUfr8NJIC1e2Oq dUHvmegCmbjw== WDCIronportException: Internal Received: from usa003306.ad.shared (HELO localhost.hgst.com) ([10.86.57.226]) by uls-op-cesaip01.wdc.com with ESMTP; 14 Jul 2020 14:18:33 -0700 From: Niklas Cassel To: Jonathan Corbet , Jens Axboe , Keith Busch , Christoph Hellwig , Sagi Grimberg , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Niklas Cassel , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org Subject: [PATCH v3 0/2] Export max open zones and max active zones to sysfs Date: Tue, 14 Jul 2020 23:18:22 +0200 Message-Id: <20200714211824.759224-1-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export max open zones and max active zones to sysfs. This patch series in based on Jens's linux-block/for-next branch. All zoned block devices in the kernel utilize the "zoned block device support" (CONFIG_BLK_DEV_ZONED). The Zoned Namespace Command Set Specification defines two different resource limits: Max Open Resources and Max Active Resources. The ZAC and ZBC standards define a MAXIMUM NUMBER OF OPEN SEQUENTIAL WRITE REQUIRED ZONES field. Since the ZNS Max Open Resources field has the same purpose as the ZAC/ZBC field, (the ZNS field is 0's based, the ZAC/ZBC field isn't), create a common "max_open_zones" definition in the sysfs documentation, and export both the ZNS field and the ZAC/ZBC field according to this new common definition. The ZNS Max Active Resources field does not have an equivalent field in ZAC/ZBC, however, since both ZAC/ZBC and ZNS utilize the "zoned block device support" in the kernel, create a "max_active_zones" definition in the sysfs documentation, similar to "max_open_zones", and export it according to this new definition. For ZAC/ZBC devices, this field will be exported as 0, meaning "no limit". Changes since v2: -Picked up Damien's Reviewed-by tags. -Update Documentation/ABI/testing/sysfs-block in addition to Documentation/block/queue-sysfs.rst (Greg). -Added bdev_max_open_zones()/bdev_max_active_zones() helpers (Johannes). Niklas Cassel (2): block: add max_open_zones to blk-sysfs block: add max_active_zones to blk-sysfs Documentation/ABI/testing/sysfs-block | 18 ++++++++++ Documentation/block/queue-sysfs.rst | 14 ++++++++ block/blk-sysfs.c | 27 +++++++++++++++ drivers/nvme/host/zns.c | 2 ++ drivers/scsi/sd_zbc.c | 5 +++ include/linux/blkdev.h | 50 +++++++++++++++++++++++++++ 6 files changed, 116 insertions(+) -- 2.26.2