mbox series

[v3,0/2] Export max open zones and max active zones to sysfs

Message ID 20200714211824.759224-1-niklas.cassel@wdc.com (mailing list archive)
Headers show
Series Export max open zones and max active zones to sysfs | expand

Message

Niklas Cassel July 14, 2020, 9:18 p.m. UTC
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(+)

Comments

Martin K. Petersen July 15, 2020, 8:19 p.m. UTC | #1
Niklas,

> Export max open zones and max active zones to sysfs.

Looks fine.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Jens Axboe July 15, 2020, 8:26 p.m. UTC | #2
On 7/14/20 3:18 PM, Niklas Cassel wrote:
> 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".

Applied, thanks.