From: Damien Le Moal <dlemoal@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>,
Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
Keith Busch <keith.busch@wdc.com>, hch <hch@lst.de>,
"dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>,
Mike Snitzer <snitzer@kernel.org>,
Mikulas Patocka <mpatocka@redhat.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
Carlos Maiolino <cem@kernel.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
David Sterba <dsterba@suse.com>
Subject: Re: [PATCH v2 11/15] block: introduce BLKREPORTZONESV2 ioctl
Date: Tue, 4 Nov 2025 08:01:29 +0900 [thread overview]
Message-ID: <35effd01-0158-4381-9803-d71b79ca775f@kernel.org> (raw)
In-Reply-To: <3c634060-494b-4319-8298-caa940e92f48@acm.org>
On 11/4/25 07:12, Bart Van Assche wrote:
> On 11/3/25 7:17 AM, Johannes Thumshirn wrote:
>> On 11/3/25 2:38 PM, Damien Le Moal wrote:
>>> Introduce the new BLKREPORTZONESV2 ioctl command to allow user
>>> applications access to the fast zone report implemented by
>>> blkdev_report_zones_cached(). This new ioctl is defined as number 142
>>> and is documented in include/uapi/linux/fs.h.
>>>
>>> Unlike the existing BLKREPORTZONES ioctl, this new ioctl uses the flags
>>> field of struct blk_zone_report also as an input. If the user sets the
>>> BLK_ZONE_REP_CACHED flag as an input, then blkdev_report_zones_cached()
>>> is used to generate the zone report using cached zone information. If
>>> this flag is not set, then BLKREPORTZONESV2 behaves in the same manner
>>> as BLKREPORTZONES and the zone report is generated by accessing the
>>> zoned device.
>>
>> Is there a downside to always do the caching? A.k.a do we need the new
>> ioctl or can we keep using the old one and cache the report zones reply?
>
> Hi Damien and Johannes,
>
> I have a different proposal, namely not to introduce BLKREPORTZONEV2 at
> all. If we keep the BLKREPORTZONE ioctl and do not introduce the
> BLKREPORTZONEV2 ioctl then in the kernel we only have to cache zone
> information that will be used by filesystems. Information that won't be
> used by filesystems doesn't have to be cached. With this approach the
> existing data structures are sufficient (struct blk_zone_wplug and
> conv_zones_bitmap) and we don't need to introduce new data structures
> for tracking zone information.
See XFS and BTFS mount code.
E.g., for XFS, xfs_mount_zones() -> xfs_get_zone_info_cb() -> xfs_init_zone().
Zone type, condition and write pointer are used. That's about everything in the
zone report and to generate that we need: (1) zone condition and (2) zone write
pointer offset. Both are available from zone write plugs and when we do not have
a zone write plug, we need the zone condition (1), and that allows us to infer
(2). For the zone type, that can always be inferred from the zone condition so
that is not cached.
So we already are caching the *minimum* amount of data needed, and that data
allows us to generate a near perfect zone report without needing to interrogate
the drive. We are not doing any "Information that won't be used by filesystems
doesn't have to be cached.". This is already optimal.
BLKREPORTZONEV2 is for users to also get the benefits of a faster zone report
for things like mkfs (formatting a large RAID volume takes a long time because
of zone reports on all drives). Removing it would be counter productive.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-11-03 23:01 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 13:31 [PATCH v2 00/15] Introduce cached report zones Damien Le Moal
2025-11-03 13:31 ` [PATCH v2 01/15] block: handle zone management operations completions Damien Le Moal
2025-11-03 13:53 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 02/15] block: freeze queue when updating zone resources Damien Le Moal
2025-11-03 13:46 ` Christoph Hellwig
2025-11-03 13:55 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 03/15] block: cleanup blkdev_report_zones() Damien Le Moal
2025-11-03 13:56 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 04/15] block: introduce disk_report_zone() Damien Le Moal
2025-11-03 14:01 ` Johannes Thumshirn
2025-11-04 0:36 ` kernel test robot
2025-11-03 13:31 ` [PATCH v2 05/15] block: reorganize struct blk_zone_wplug Damien Le Moal
2025-11-03 14:01 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 06/15] block: use zone condition to determine conventional zones Damien Le Moal
2025-11-03 14:52 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 07/15] block: track zone conditions Damien Le Moal
2025-11-03 15:00 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 08/15] block: refactor blkdev_report_zones() code Damien Le Moal
2025-11-03 13:47 ` Christoph Hellwig
2025-11-03 15:01 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 09/15] block: introduce blkdev_get_zone_info() Damien Le Moal
2025-11-03 15:12 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 10/15] block: introduce blkdev_report_zones_cached() Damien Le Moal
2025-11-03 13:31 ` [PATCH v2 11/15] block: introduce BLKREPORTZONESV2 ioctl Damien Le Moal
2025-11-03 15:17 ` Johannes Thumshirn
2025-11-03 22:12 ` Bart Van Assche
2025-11-03 23:01 ` Damien Le Moal [this message]
2025-11-04 0:15 ` Damien Le Moal
2025-11-04 1:01 ` Bart Van Assche
2025-11-04 1:20 ` Damien Le Moal
2025-11-04 7:23 ` Johannes Thumshirn
2025-11-04 7:38 ` Damien Le Moal
2025-11-03 13:31 ` [PATCH v2 12/15] block: improve zone_wplugs debugfs attribute output Damien Le Moal
2025-11-03 13:47 ` Christoph Hellwig
2025-11-03 15:18 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 13/15] block: add zone write plug condition to debugfs zone_wplugs Damien Le Moal
2025-11-03 15:23 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 14/15] btrfs: use blkdev_report_zones_cached() Damien Le Moal
2025-11-03 15:26 ` Johannes Thumshirn
2025-11-03 13:31 ` [PATCH v2 15/15] xfs: " Damien Le Moal
2025-11-03 15:27 ` Johannes Thumshirn
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=35effd01-0158-4381-9803-d71b79ca775f@kernel.org \
--to=dlemoal@kernel.org \
--cc=Johannes.Thumshirn@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=cem@kernel.org \
--cc=dm-devel@lists.linux.dev \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=keith.busch@wdc.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpatocka@redhat.com \
--cc=snitzer@kernel.org \
/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