All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Damien Le Moal <damien.lemoal@wdc.com>,
	dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>,
	linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v5 01/11] block: improve handling of all zones reset operation
Date: Wed, 26 May 2021 08:36:43 +0200	[thread overview]
Message-ID: <c052d85b-bd8e-711f-75df-829470d22f6d@suse.de> (raw)
In-Reply-To: <20210525212501.226888-2-damien.lemoal@wdc.com>

On 5/25/21 11:24 PM, Damien Le Moal wrote:
> SCSI, ZNS and null_blk zoned devices support resetting all zones using
> a single command (REQ_OP_ZONE_RESET_ALL), as indicated using the device
> request queue flag QUEUE_FLAG_ZONE_RESETALL. This flag is not set for
> device mapper targets creating zoned devices. In this case, a user
> request for resetting all zones of a device is processed in
> blkdev_zone_mgmt() by issuing a REQ_OP_ZONE_RESET operation for each
> zone of the device. This leads to different behaviors of the
> BLKRESETZONE ioctl() depending on the target device support for the
> reset all operation. E.g.
> 
> blkzone reset /dev/sdX
> 
> will reset all zones of a SCSI device using a single command that will
> ignore conventional, read-only or offline zones.
> 
> But a dm-linear device including conventional, read-only or offline
> zones cannot be reset in the same manner as some of the single zone
> reset operations issued by blkdev_zone_mgmt() will fail. E.g.:
> 
> blkzone reset /dev/dm-Y
> blkzone: /dev/dm-0: BLKRESETZONE ioctl failed: Remote I/O error
> 
> To simplify applications and tools development, unify the behavior of
> the all-zone reset operation by modifying blkdev_zone_mgmt() to not
> issue a zone reset operation for conventional, read-only and offline
> zones, thus mimicking what an actual reset-all device command does on a
> device supporting REQ_OP_ZONE_RESET_ALL. This emulation is done using
> the new function blkdev_zone_reset_all_emulated(). The zones needing a
> reset are identified using a bitmap that is initialized using a zone
> report. Since empty zones do not need a reset, also ignore these zones.
> The function blkdev_zone_reset_all() is introduced for block devices
> natively supporting reset all operations. blkdev_zone_mgmt() is modified
> to call either function to execute an all zone reset request.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> [hch: split into multiple functions]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>   block/blk-zoned.c | 119 +++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 92 insertions(+), 27 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

WARNING: multiple messages have this Message-ID (diff)
From: Hannes Reinecke <hare@suse.de>
To: Damien Le Moal <damien.lemoal@wdc.com>,
	dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>,
	linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [dm-devel] [PATCH v5 01/11] block: improve handling of all zones reset operation
Date: Wed, 26 May 2021 08:36:43 +0200	[thread overview]
Message-ID: <c052d85b-bd8e-711f-75df-829470d22f6d@suse.de> (raw)
In-Reply-To: <20210525212501.226888-2-damien.lemoal@wdc.com>

On 5/25/21 11:24 PM, Damien Le Moal wrote:
> SCSI, ZNS and null_blk zoned devices support resetting all zones using
> a single command (REQ_OP_ZONE_RESET_ALL), as indicated using the device
> request queue flag QUEUE_FLAG_ZONE_RESETALL. This flag is not set for
> device mapper targets creating zoned devices. In this case, a user
> request for resetting all zones of a device is processed in
> blkdev_zone_mgmt() by issuing a REQ_OP_ZONE_RESET operation for each
> zone of the device. This leads to different behaviors of the
> BLKRESETZONE ioctl() depending on the target device support for the
> reset all operation. E.g.
> 
> blkzone reset /dev/sdX
> 
> will reset all zones of a SCSI device using a single command that will
> ignore conventional, read-only or offline zones.
> 
> But a dm-linear device including conventional, read-only or offline
> zones cannot be reset in the same manner as some of the single zone
> reset operations issued by blkdev_zone_mgmt() will fail. E.g.:
> 
> blkzone reset /dev/dm-Y
> blkzone: /dev/dm-0: BLKRESETZONE ioctl failed: Remote I/O error
> 
> To simplify applications and tools development, unify the behavior of
> the all-zone reset operation by modifying blkdev_zone_mgmt() to not
> issue a zone reset operation for conventional, read-only and offline
> zones, thus mimicking what an actual reset-all device command does on a
> device supporting REQ_OP_ZONE_RESET_ALL. This emulation is done using
> the new function blkdev_zone_reset_all_emulated(). The zones needing a
> reset are identified using a bitmap that is initialized using a zone
> report. Since empty zones do not need a reset, also ignore these zones.
> The function blkdev_zone_reset_all() is introduced for block devices
> natively supporting reset all operations. blkdev_zone_mgmt() is modified
> to call either function to execute an all zone reset request.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> [hch: split into multiple functions]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>   block/blk-zoned.c | 119 +++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 92 insertions(+), 27 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2021-05-26  6:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 21:24 [PATCH v5 00/11] dm: Improve zoned block device support Damien Le Moal
2021-05-25 21:24 ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 01/11] block: improve handling of all zones reset operation Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-26  6:36   ` Hannes Reinecke [this message]
2021-05-26  6:36     ` Hannes Reinecke
2021-05-25 21:24 ` [PATCH v5 02/11] block: introduce bio zone helpers Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 03/11] block: introduce BIO_ZONE_WRITE_LOCKED bio flag Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 04/11] dm: Fix dm_accept_partial_bio() Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 05/11] dm: cleanup device_area_is_invalid() Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 06/11] dm: move zone related code to dm-zone.c Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 07/11] dm: Introduce dm_report_zones() Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 08/11] dm: Forbid requeue of writes to zones Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-06-04 14:56   ` Mike Snitzer
2021-06-04 14:56     ` [dm-devel] " Mike Snitzer
2021-06-05  0:17     ` Damien Le Moal
2021-06-05  0:17       ` [dm-devel] " Damien Le Moal
2021-05-25 21:24 ` [PATCH v5 09/11] dm: rearrange core declarations Damien Le Moal
2021-05-25 21:24   ` [dm-devel] " Damien Le Moal
2021-05-25 21:25 ` [PATCH v5 10/11] dm: introduce zone append emulation Damien Le Moal
2021-05-25 21:25   ` [dm-devel] " Damien Le Moal
2021-05-26  6:40   ` Hannes Reinecke
2021-05-26  6:40     ` [dm-devel] " Hannes Reinecke
2021-05-25 21:25 ` [PATCH v5 11/11] dm crypt: Fix zoned block device support Damien Le Moal
2021-05-25 21:25   ` [dm-devel] " Damien Le Moal
2021-06-01 22:57 ` [PATCH v5 00/11] dm: Improve " Damien Le Moal
2021-06-01 22:57   ` [dm-devel] " Damien Le Moal
2021-06-02 18:32   ` Mike Snitzer
2021-06-02 18:32     ` [dm-devel] " Mike Snitzer
2021-06-03 17:46     ` Jens Axboe
2021-06-03 17:46       ` [dm-devel] " Jens Axboe
2021-06-03 22:16       ` Mike Snitzer
2021-06-03 22:16         ` [dm-devel] " Mike Snitzer
2021-06-03 23:44         ` Damien Le Moal
2021-06-03 23:44           ` [dm-devel] " Damien Le Moal

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=c052d85b-bd8e-711f-75df-829470d22f6d@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=snitzer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.