All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Pankaj Raghav <p.raghav@samsung.com>
Cc: axboe@kernel.dk, Damien Le Moal <damien.lemoal@wdc.com>,
	bvanassche@acm.org, pankydev8@gmail.com,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	damien.lemoal@opensource.wdc.com, snitzer@kernel.org,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	matias.bjorling@wdc.com, gost.dev@samsung.com,
	jaegeuk@kernel.org, hch@lst.de, agk@redhat.com
Subject: Re: [dm-devel] [PATCH v12 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes
Date: Fri, 2 Sep 2022 17:07:03 -0400	[thread overview]
Message-ID: <YxJwd7xcZRdznsYz@redhat.com> (raw)
In-Reply-To: <YxJttvB2Z5I58SQ5@redhat.com>

On Fri, Sep 02 2022 at  4:55P -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Tue, Aug 23 2022 at  8:18P -0400,
> Pankaj Raghav <p.raghav@samsung.com> wrote:
> 
> > Only zoned devices with power-of-2(po2) number of sectors per zone(zone
> > size) were supported in linux but now non power-of-2(npo2) zone sizes
> > support has been added to the block layer.
> > 
> > Filesystems such as F2FS and btrfs have support for zoned devices with
> > po2 zone size assumption. Before adding native support for npo2 zone
> > sizes, it was suggested to create a dm target for npo2 zone size device to
> > appear as a po2 zone size target so that file systems can initially
> > work without any explicit changes by using this target.
> > 
> > The design of this target is very simple: remap the device zone size to
> > the zone capacity and change the zone size to be the nearest power of 2
> > value.
> > 
> > For e.g., a device with a zone size/capacity of 3M will have an equivalent
> > target layout as follows:
> > 
> > Device layout :-
> > zone capacity = 3M
> > zone size = 3M
> > 
> > |--------------|-------------|
> > 0             3M            6M
> > 
> > Target layout :-
> > zone capacity=3M
> > zone size = 4M
> > 
> > |--------------|---|--------------|---|
> > 0             3M  4M             7M  8M
> > 
> > The area between target's zone capacity and zone size will be emulated
> > in the target.
> > The read IOs that fall in the emulated gap area will return 0 filled
> > bio and all the other IOs in that area will result in an error.
> > If a read IO span across the emulated area boundary, then the IOs are
> > split across them. All other IO operations that span across the emulated
> > area boundary will result in an error.
> > 
> > The target can be easily created as follows:
> > dmsetup create <label> --table '0 <size_sects> po2zone /dev/nvme<id>'
> > 
> > Note that the target does not support partial mapping of the underlying
> > device.
> > 
> > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> > Suggested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
> > Suggested-by: Hannes Reinecke <hare@suse.de>
> 
> 
> This target needs more review from those who Suggested-by it.
> 
> And the header and docs needs to address:
> 
> 1) why is a partial mapping of the underlying device disallowed?
> 2) why is it assumed all IO is read-only? (talk to me and others like
>    we don't know the inherent limitations of this class of zoned hw)
> 
> On a code level:
> 1) are you certain you're properly failing all writes?
>    - are writes allowed to the "zone capacity area" but _not_
>      allowed to the "emulated zone area"? (if yes, _please document_). 
> 2) yes, you absolutely need to implement the .status target_type hook
>    (for both STATUS and TABLE).
> 3) really not loving the nested return (of DM_MAPIO_SUBMITTED or
>    DM_MAPIO_REMAPPED) from methods called from dm_po2z_map().  Would
>    prefer to not have to do a depth-first search to see where and when
>    dm_po2z_map() returns a DM_MAPIO_XXX unless there is a solid
>    justification for it.  To me it just obfuscates the DM interface a
>    bit too much. 
> 
> Otherwise, pretty clean code and nothing weird going on.
> 
> I look forward to seeing your next (final?) revision of this patchset.

Thinking further.. I'm left confused about just what the heck this
target is assuming.

E.g.: feels like its exposing a readonly end of the zone is very
bi-polar... yet no hint to upper layer it shouldn't write to that
read-only end (the "emulated zone").. but there has to be some zoned
magic assumed?  And I'm just naive?

Mike

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


WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Pankaj Raghav <p.raghav@samsung.com>
Cc: agk@redhat.com, snitzer@kernel.org, axboe@kernel.dk,
	damien.lemoal@opensource.wdc.com, hch@lst.de,
	Damien Le Moal <damien.lemoal@wdc.com>,
	bvanassche@acm.org, pankydev8@gmail.com,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	gost.dev@samsung.com, jaegeuk@kernel.org,
	matias.bjorling@wdc.com
Subject: Re: [PATCH v12 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes
Date: Fri, 2 Sep 2022 17:07:03 -0400	[thread overview]
Message-ID: <YxJwd7xcZRdznsYz@redhat.com> (raw)
In-Reply-To: <YxJttvB2Z5I58SQ5@redhat.com>

On Fri, Sep 02 2022 at  4:55P -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Tue, Aug 23 2022 at  8:18P -0400,
> Pankaj Raghav <p.raghav@samsung.com> wrote:
> 
> > Only zoned devices with power-of-2(po2) number of sectors per zone(zone
> > size) were supported in linux but now non power-of-2(npo2) zone sizes
> > support has been added to the block layer.
> > 
> > Filesystems such as F2FS and btrfs have support for zoned devices with
> > po2 zone size assumption. Before adding native support for npo2 zone
> > sizes, it was suggested to create a dm target for npo2 zone size device to
> > appear as a po2 zone size target so that file systems can initially
> > work without any explicit changes by using this target.
> > 
> > The design of this target is very simple: remap the device zone size to
> > the zone capacity and change the zone size to be the nearest power of 2
> > value.
> > 
> > For e.g., a device with a zone size/capacity of 3M will have an equivalent
> > target layout as follows:
> > 
> > Device layout :-
> > zone capacity = 3M
> > zone size = 3M
> > 
> > |--------------|-------------|
> > 0             3M            6M
> > 
> > Target layout :-
> > zone capacity=3M
> > zone size = 4M
> > 
> > |--------------|---|--------------|---|
> > 0             3M  4M             7M  8M
> > 
> > The area between target's zone capacity and zone size will be emulated
> > in the target.
> > The read IOs that fall in the emulated gap area will return 0 filled
> > bio and all the other IOs in that area will result in an error.
> > If a read IO span across the emulated area boundary, then the IOs are
> > split across them. All other IO operations that span across the emulated
> > area boundary will result in an error.
> > 
> > The target can be easily created as follows:
> > dmsetup create <label> --table '0 <size_sects> po2zone /dev/nvme<id>'
> > 
> > Note that the target does not support partial mapping of the underlying
> > device.
> > 
> > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> > Suggested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
> > Suggested-by: Hannes Reinecke <hare@suse.de>
> 
> 
> This target needs more review from those who Suggested-by it.
> 
> And the header and docs needs to address:
> 
> 1) why is a partial mapping of the underlying device disallowed?
> 2) why is it assumed all IO is read-only? (talk to me and others like
>    we don't know the inherent limitations of this class of zoned hw)
> 
> On a code level:
> 1) are you certain you're properly failing all writes?
>    - are writes allowed to the "zone capacity area" but _not_
>      allowed to the "emulated zone area"? (if yes, _please document_). 
> 2) yes, you absolutely need to implement the .status target_type hook
>    (for both STATUS and TABLE).
> 3) really not loving the nested return (of DM_MAPIO_SUBMITTED or
>    DM_MAPIO_REMAPPED) from methods called from dm_po2z_map().  Would
>    prefer to not have to do a depth-first search to see where and when
>    dm_po2z_map() returns a DM_MAPIO_XXX unless there is a solid
>    justification for it.  To me it just obfuscates the DM interface a
>    bit too much. 
> 
> Otherwise, pretty clean code and nothing weird going on.
> 
> I look forward to seeing your next (final?) revision of this patchset.

Thinking further.. I'm left confused about just what the heck this
target is assuming.

E.g.: feels like its exposing a readonly end of the zone is very
bi-polar... yet no hint to upper layer it shouldn't write to that
read-only end (the "emulated zone").. but there has to be some zoned
magic assumed?  And I'm just naive?

Mike


  reply	other threads:[~2022-09-02 21:07 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220823121901eucas1p1d8ec2e0d3d6be63b9d4338f70dd717fe@eucas1p1.samsung.com>
2022-08-23 12:18 ` [dm-devel] [PATCH v12 00/13] support zoned block devices with non-power-of-2 zone sizes Pankaj Raghav
2022-08-23 12:18   ` Pankaj Raghav
2022-08-23 12:18   ` [dm-devel] [PATCH v12 01/13] block: make bdev_nr_zones and disk_zone_no generic for npo2 zone size Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-23 12:18   ` [dm-devel] [PATCH v12 02/13] block:rearrange bdev_{is_zoned, zone_sectors, get_queue} helpers in blkdev.h Pankaj Raghav
2022-08-23 12:18     ` [PATCH v12 02/13] block:rearrange bdev_{is_zoned,zone_sectors,get_queue} " Pankaj Raghav
2022-08-25 21:45     ` [dm-devel] [PATCH v12 02/13] block:rearrange bdev_{is_zoned, zone_sectors, get_queue} " Bart Van Assche
2022-08-25 21:45       ` [PATCH v12 02/13] block:rearrange bdev_{is_zoned,zone_sectors,get_queue} " Bart Van Assche
2022-08-23 12:18   ` [dm-devel] [PATCH v12 03/13] block: allow blk-zoned devices to have non-power-of-2 zone size Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-26 20:06     ` [dm-devel] " Jonathan Derrick
2022-08-26 20:06       ` Jonathan Derrick
2022-08-26 20:09       ` [dm-devel] " Jonathan Derrick
2022-08-26 20:09         ` Jonathan Derrick
2022-08-23 12:18   ` [dm-devel] [PATCH v12 04/13] nvmet: Allow ZNS target to support non-power_of_2 zone sizes Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-23 12:18   ` [dm-devel] [PATCH v12 05/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-25 21:46     ` [dm-devel] " Bart Van Assche
2022-08-25 21:46       ` Bart Van Assche
2022-08-23 12:18   ` [dm-devel] [PATCH v12 06/13] null_blk: allow zoned devices with non power-of-2 zone sizes Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-25 21:49     ` [dm-devel] " Bart Van Assche
2022-08-25 21:49       ` Bart Van Assche
2022-08-23 12:18   ` [dm-devel] [PATCH v12 07/13] zonefs: allow non power of 2 zoned devices Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-23 12:18   ` [dm-devel] [PATCH v12 08/13] dm-zoned: ensure only power of 2 zone sizes are allowed Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-25 21:50     ` [dm-devel] " Bart Van Assche
2022-08-25 21:50       ` Bart Van Assche
2022-09-02  0:16     ` Mike Snitzer
2022-09-02  0:16       ` Mike Snitzer
2022-08-23 12:18   ` [dm-devel] [PATCH v12 09/13] dm-zone: use generic helpers to calculate offset from zone start Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-25 21:53     ` [dm-devel] " Bart Van Assche
2022-08-25 21:53       ` Bart Van Assche
2022-09-02  0:16     ` [dm-devel] " Mike Snitzer
2022-09-02  0:16       ` Mike Snitzer
2022-08-23 12:18   ` [dm-devel] [PATCH v12 10/13] dm-table: allow zoned devices with non power-of-2 zone sizes Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-09-02  0:17     ` [dm-devel] " Mike Snitzer
2022-09-02  0:17       ` Mike Snitzer
2022-08-23 12:18   ` [dm-devel] [PATCH v12 11/13] dm: call dm_zone_endio after the target endio callback for zoned devices Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-09-02  0:18     ` [dm-devel] " Mike Snitzer
2022-09-02  0:18       ` Mike Snitzer
2022-08-23 12:18   ` [dm-devel] [PATCH v12 12/13] dm: introduce DM_EMULATED_ZONES target type Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-09-02  0:28     ` [dm-devel] " Mike Snitzer
2022-09-02  0:28       ` Mike Snitzer
2022-09-02 12:02       ` [dm-devel] " Pankaj Raghav
2022-09-02 12:02         ` Pankaj Raghav
2022-09-02 18:43         ` [dm-devel] " Mike Snitzer
2022-09-02 18:43           ` Mike Snitzer
2022-08-23 12:18   ` [dm-devel] [PATCH v12 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Pankaj Raghav
2022-08-23 12:18     ` Pankaj Raghav
2022-08-30  2:52     ` [dm-devel] " Shinichiro Kawasaki
2022-08-30  2:52       ` Shinichiro Kawasaki
2022-08-30 10:03       ` [dm-devel] " Pankaj Raghav
2022-08-30 10:03         ` Pankaj Raghav
2022-09-02 12:05     ` [dm-devel] " Pankaj Raghav
2022-09-02 12:05       ` Pankaj Raghav
2022-09-02 20:55     ` [dm-devel] " Mike Snitzer
2022-09-02 20:55       ` Mike Snitzer
2022-09-02 21:07       ` Mike Snitzer [this message]
2022-09-02 21:07         ` Mike Snitzer
2022-09-05 12:57         ` [dm-devel] " Pankaj Raghav
2022-09-05 12:57           ` Pankaj Raghav
2022-09-05 12:48       ` [dm-devel] " Pankaj Raghav
2022-09-05 12:48         ` Pankaj Raghav

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=YxJwd7xcZRdznsYz@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=matias.bjorling@wdc.com \
    --cc=p.raghav@samsung.com \
    --cc=pankydev8@gmail.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 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.