From: Niklas Cassel <nks@flawful.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Jaegeuk Kim <jaegeuk@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Ming Lei <ming.lei@redhat.com>, Matias Bjorling <mb@lightnvm.io>
Subject: Re: [PATCH v2 10/11] block: Add support for the zone capacity concept
Date: Thu, 20 Apr 2023 11:23:39 +0200 [thread overview]
Message-ID: <ZEEEm/5+i7x2i8a5@x1-carbon> (raw)
In-Reply-To: <20230418224002.1195163-11-bvanassche@acm.org>
On Tue, Apr 18, 2023 at 03:40:01PM -0700, Bart Van Assche wrote:
> Make the zone capacity available in struct queue_limits for those
> drivers that need it.
>
> Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> Documentation/ABI/stable/sysfs-block | 8 ++++++++
> block/blk-settings.c | 1 +
> block/blk-sysfs.c | 7 +++++++
> block/blk-zoned.c | 15 +++++++++++++++
> include/linux/blkdev.h | 1 +
> 5 files changed, 32 insertions(+)
>
> diff --git a/Documentation/ABI/stable/sysfs-block b/Documentation/ABI/stable/sysfs-block
> index c57e5b7cb532..4527d0514fdb 100644
> --- a/Documentation/ABI/stable/sysfs-block
> +++ b/Documentation/ABI/stable/sysfs-block
> @@ -671,6 +671,14 @@ Description:
> regular block devices.
>
>
> +What: /sys/block/<disk>/queue/zone_capacity
> +Date: March 2023
> +Contact: linux-block@vger.kernel.org
> +Description:
> + [RO] The number of 512-byte sectors in a zone that can be read
> + or written. This number is less than or equal to the zone size.
> +
> +
> What: /sys/block/<disk>/queue/zone_write_granularity
> Date: January 2021
> Contact: linux-block@vger.kernel.org
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index 896b4654ab00..96f5dc63a815 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -685,6 +685,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
> b->max_secure_erase_sectors);
> t->zone_write_granularity = max(t->zone_write_granularity,
> b->zone_write_granularity);
> + t->zone_capacity = max(t->zone_capacity, b->zone_capacity);
> t->zoned = max(t->zoned, b->zoned);
> return ret;
> }
(snip)
> @@ -496,12 +498,23 @@ static int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx,
> disk->disk_name);
> return -ENODEV;
> }
> + if (zone->capacity != args->zone_capacity) {
> + pr_warn("%s: Invalid zoned device with non constant zone capacity\n",
> + disk->disk_name);
> + return -ENODEV;
Hello Bart,
The NVMe Zoned Namespace Command Set Specification:
https://nvmexpress.org/wp-content/uploads/NVM-Express-Zoned-Namespace-Command-Set-Specification-1.1c-2022.10.03-Ratified.pdf
specifies the Zone Capacity (ZCAP) field in each Zone Descriptor.
The Descriptors are part of the Report Zones Data Structure.
This means that while the zone size is the same for all zones,
the zone capacity can be different for each zone.
While the single NVMe ZNS SSD that I've encountered so far did
coincidentally have the same zone capacity for all zones, this
is not required by the specification.
The NVMe driver does reject a ZNS device that has support for
Variable Zone Capacity (which is defined in the ZOC field):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/nvme/host/zns.c?h=v6.3-rc7#n95
Variable Zone Capacity simply means the the zone capacities
cannot change without a NVM format.
However, even when Variable Zone Capacity is not supported,
a NVMe ZNS device can still have different zone capacities,
and AFAICT, such devices are currently supported.
With your change above, we would start rejecting such devices.
Is this reduction of supported NVMe ZNS SSD devices really desired?
If it is, then I would at least expect to find a motivation of why we
are reducing the scope of the currently supported NVMe ZNS devices
to be found somewhere in the commit message.
Kind regards,
Niklas
next prev parent reply other threads:[~2023-04-20 9:25 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 22:39 [PATCH v2 00/11] mq-deadline: Improve support for zoned block devices Bart Van Assche
2023-04-18 22:39 ` [PATCH v2 01/11] block: Simplify blk_req_needs_zone_write_lock() Bart Van Assche
2023-04-19 4:09 ` Christoph Hellwig
2023-04-18 22:39 ` [PATCH v2 02/11] block: Micro-optimize blk_req_needs_zone_write_lock() Bart Van Assche
2023-04-19 4:11 ` Christoph Hellwig
2023-04-19 18:30 ` Bart Van Assche
2023-04-20 5:00 ` Christoph Hellwig
2023-04-18 22:39 ` [PATCH v2 03/11] block: Introduce blk_rq_is_seq_zoned_write() Bart Van Assche
2023-04-19 4:50 ` Christoph Hellwig
2023-04-19 21:12 ` Bart Van Assche
2023-04-20 1:03 ` Damien Le Moal
2023-04-20 5:01 ` Christoph Hellwig
2023-04-18 22:39 ` [PATCH v2 04/11] block: mq-deadline: Simplify deadline_skip_seq_writes() Bart Van Assche
2023-04-19 4:52 ` Christoph Hellwig
2023-04-18 22:39 ` [PATCH v2 05/11] block: mq-deadline: Improve deadline_skip_seq_writes() Bart Van Assche
2023-04-18 22:39 ` [PATCH v2 06/11] block: mq-deadline: Disable head insertion for zoned writes Bart Van Assche
2023-04-19 4:30 ` Christoph Hellwig
2023-04-19 22:43 ` Bart Van Assche
2023-04-20 5:06 ` Christoph Hellwig
2023-04-20 17:00 ` Bart Van Assche
2023-04-24 7:00 ` Christoph Hellwig
2023-04-18 22:39 ` [PATCH v2 07/11] block: mq-deadline: Preserve write streams for all device types Bart Van Assche
2023-04-18 22:39 ` [PATCH v2 08/11] block: mq-deadline: Fix a race condition related to zoned writes Bart Van Assche
2023-04-19 5:07 ` Christoph Hellwig
2023-04-19 18:46 ` Bart Van Assche
2023-04-20 1:00 ` Damien Le Moal
2023-04-18 22:40 ` [PATCH v2 09/11] block: mq-deadline: Handle requeued requests correctly Bart Van Assche
2023-04-19 5:07 ` Christoph Hellwig
2023-04-19 23:01 ` Bart Van Assche
2023-04-20 1:07 ` Damien Le Moal
2023-04-18 22:40 ` [PATCH v2 10/11] block: Add support for the zone capacity concept Bart Van Assche
2023-04-20 9:23 ` Niklas Cassel [this message]
2023-04-20 17:12 ` Bart Van Assche
2023-04-20 22:00 ` Damien Le Moal
2023-04-20 22:51 ` Bart Van Assche
2023-04-20 23:37 ` Damien Le Moal
2023-04-20 23:44 ` Bart Van Assche
2023-04-20 23:53 ` Damien Le Moal
2023-04-21 0:29 ` Jaegeuk Kim
2023-04-21 1:52 ` Damien Le Moal
2023-04-21 20:15 ` Jaegeuk Kim
2023-04-21 22:25 ` Damien Le Moal
2023-04-24 6:01 ` Christoph Hellwig
2023-04-24 17:58 ` Jaegeuk Kim
2023-04-24 19:05 ` Jaegeuk Kim
2023-04-25 13:38 ` Damien Le Moal
2023-04-24 17:48 ` Jaegeuk Kim
2023-04-18 22:40 ` [PATCH v2 11/11] block: mq-deadline: Respect the active zone limit Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZEEEm/5+i7x2i8a5@x1-carbon \
--to=nks@flawful.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=hch@lst.de \
--cc=jaegeuk@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=mb@lightnvm.io \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox