mbox series

[v2,0/5] Remove zone reset all emulation

Message ID 20240704052816.623865-1-dlemoal@kernel.org (mailing list archive)
Headers show
Series Remove zone reset all emulation | expand

Message

Damien Le Moal July 4, 2024, 5:28 a.m. UTC
Jens, Mike,

Here is a set of patches based on block/for-next to remove the emulation
for zone reset all from the block layer and move it to device mapper.
This is done because device mapper is the only zoned device driver that
does not natively support REQ_OP_ZONE_RESET_ALL. With this change, the
emulation that may be required depending on a mapped device zone mapping
is moved to device mapper and the reset all feature
(BLK_FEAT_ZONE_RESETALL) can be deleted, as well as all the code
handling this feature in blk-zoned.c. The DM-based handling of
REQ_OP_ZONE_RESET_ALL can also be much faster than the block layer
emulation as that operation can be forwarded as is to targets mapping
all sequential write required zones.

Patch 1 modifies null_blk to add the zone_full parameter to initialize
the sequential zones of a zoned null_blk device to be full. This is
convenient when testing read workloads as well as zone management
operations as that avoids having to first write to device to make the
zones full.

Patch 2 is a simple prep patch for patch 3. Patch 3 implements the
emulation for zone reset all in device mapper core code.

Patch 4 removes the block layer based emulation and modifies all drivers
setting the BLK_FEAT_ZONE_RESETALL queue limit feature to not set this
feature (and the feature is removed). This enables the use of the device
mapper emulation.

Patch 5 is a cleanup of blk-zoned.c made possible with patch 4.

Changes from v1:
 - Fixed typo in the commit message and long comment line of patch 3.
   Also removed the stubbed definition of dm_zone_get_reset_bitmap() in
   dm.h as it is not necessary.
 - Modified patch 4 to have submit_bio_noacct() treat
   REQ_OP_ZONE_RESET_ALL the same way as other zone operations.

Damien Le Moal (5):
  null_blk: Introduce the zone_full parameter
  dm: Refactor is_abnormal_io()
  dm: handle REQ_OP_ZONE_RESET_ALL
  block: Remove REQ_OP_ZONE_RESET_ALL emulation
  block: Remove blk_alloc_zone_bitmap()

 block/blk-core.c                  |   5 +-
 block/blk-zoned.c                 |  88 +----------------
 drivers/block/null_blk/main.c     |   9 +-
 drivers/block/null_blk/null_blk.h |   1 +
 drivers/block/null_blk/zoned.c    |  12 ++-
 drivers/block/ublk_drv.c          |   2 +-
 drivers/block/virtio_blk.c        |   2 +-
 drivers/md/dm-zone.c              |  50 +++++++++-
 drivers/md/dm.c                   | 159 +++++++++++++++++++++++++++---
 drivers/md/dm.h                   |   3 +
 drivers/nvme/host/zns.c           |   2 +-
 drivers/scsi/sd_zbc.c             |   2 +-
 include/linux/blkdev.h            |   5 -
 include/linux/device-mapper.h     |   7 ++
 14 files changed, 229 insertions(+), 118 deletions(-)

Comments

Johannes Thumshirn July 4, 2024, 6:07 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Martin K. Petersen July 5, 2024, 3:30 a.m. UTC | #2
Damien,

> Here is a set of patches based on block/for-next to remove the
> emulation for zone reset all from the block layer and move it to
> device mapper. This is done because device mapper is the only zoned
> device driver that does not natively support REQ_OP_ZONE_RESET_ALL.
> With this change, the emulation that may be required depending on a
> mapped device zone mapping is moved to device mapper and the reset all
> feature (BLK_FEAT_ZONE_RESETALL) can be deleted, as well as all the
> code handling this feature in blk-zoned.c. The DM-based handling of
> REQ_OP_ZONE_RESET_ALL can also be much faster than the block layer
> emulation as that operation can be forwarded as is to targets mapping
> all sequential write required zones.

LGTM.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Jens Axboe July 5, 2024, 6:42 a.m. UTC | #3
On Thu, 04 Jul 2024 14:28:11 +0900, Damien Le Moal wrote:
> Jens, Mike,
> 
> Here is a set of patches based on block/for-next to remove the emulation
> for zone reset all from the block layer and move it to device mapper.
> This is done because device mapper is the only zoned device driver that
> does not natively support REQ_OP_ZONE_RESET_ALL. With this change, the
> emulation that may be required depending on a mapped device zone mapping
> is moved to device mapper and the reset all feature
> (BLK_FEAT_ZONE_RESETALL) can be deleted, as well as all the code
> handling this feature in blk-zoned.c. The DM-based handling of
> REQ_OP_ZONE_RESET_ALL can also be much faster than the block layer
> emulation as that operation can be forwarded as is to targets mapping
> all sequential write required zones.
> 
> [...]

Applied, thanks!

[1/5] null_blk: Introduce the zone_full parameter
      commit: f4d5dc33c823ef1d7ccbbd2d1e40b871fad0012b
[2/5] dm: Refactor is_abnormal_io()
      commit: ae7e965b36e3132238d16b4ccd223f65162397b5
[3/5] dm: handle REQ_OP_ZONE_RESET_ALL
      commit: 81e7706345f06e1e97a092f59697b7e20a0ee868
[4/5] block: Remove REQ_OP_ZONE_RESET_ALL emulation
      commit: f2a7bea23710fceb99dac6da4ef82c3cc8932f7f
[5/5] block: Remove blk_alloc_zone_bitmap()
      commit: 2f20872ed43185780a5f30581472599342c86d4a

Best regards,