All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Raghav <p.raghav@samsung.com>
To: Mike Snitzer <snitzer@redhat.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: Mon, 5 Sep 2022 14:57:08 +0200	[thread overview]
Message-ID: <67726654-2c13-2c41-c002-30dc99db8497@samsung.com> (raw)
In-Reply-To: <YxJwd7xcZRdznsYz@redhat.com>

>>
>> 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?
> 

You are absolutely right about "zoned magic". Applications that use a zoned
block device are aware of the zone capacity and zone size. BLKREPORTZONE
ioctl is typically used to get the zone information from a zoned block device.

This target adjusts the zone report so that zone size and zone capacity are
modified correctly (see dm_po2z_report_zones() and
dm_po2z_report_zones_cb() functions).

WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Raghav <p.raghav@samsung.com>
To: Mike Snitzer <snitzer@redhat.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: Mon, 5 Sep 2022 14:57:08 +0200	[thread overview]
Message-ID: <67726654-2c13-2c41-c002-30dc99db8497@samsung.com> (raw)
In-Reply-To: <YxJwd7xcZRdznsYz@redhat.com>

>>
>> 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?
> 

You are absolutely right about "zoned magic". Applications that use a zoned
block device are aware of the zone capacity and zone size. BLKREPORTZONE
ioctl is typically used to get the zone information from a zoned block device.

This target adjusts the zone report so that zone size and zone capacity are
modified correctly (see dm_po2z_report_zones() and
dm_po2z_report_zones_cb() functions).

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


  reply	other threads:[~2022-09-05 12:57 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
     [not found]   ` <CGME20220823121902eucas1p21176f8fff1a4f928bee6e03141cdf69a@eucas1p2.samsung.com>
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
     [not found]   ` <CGME20220823121903eucas1p230518b312d5260d28e356ba911a27469@eucas1p2.samsung.com>
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
     [not found]   ` <CGME20220823121904eucas1p1cdedb3e9af928e25564f46e70765d39b@eucas1p1.samsung.com>
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       ` Jonathan Derrick
2022-08-26 20:06         ` [dm-devel] " Jonathan Derrick
2022-08-26 20:09         ` Jonathan Derrick
2022-08-26 20:09           ` [dm-devel] " Jonathan Derrick
     [not found]   ` <CGME20220823121905eucas1p14db498525742a606137e098b3cb8f70b@eucas1p1.samsung.com>
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
     [not found]   ` <CGME20220823121907eucas1p295c375935b556729864dce39534c2579@eucas1p2.samsung.com>
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
     [not found]   ` <CGME20220823121907eucas1p27664a441113cb557af8fce3ef2800e34@eucas1p2.samsung.com>
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
     [not found]   ` <CGME20220823121909eucas1p16b613217afcb29c29d6149c2620c93b4@eucas1p1.samsung.com>
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
     [not found]   ` <CGME20220823121909eucas1p113c0c29f7e28d0ee3e1161f7da243baf@eucas1p1.samsung.com>
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         ` [dm-devel] " Mike Snitzer
     [not found]   ` <CGME20220823121911eucas1p2a55dec72a6d780123e6c7655aee72457@eucas1p2.samsung.com>
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       ` Bart Van Assche
2022-08-25 21:53         ` [dm-devel] " Bart Van Assche
2022-09-02  0:16       ` Mike Snitzer
2022-09-02  0:16         ` [dm-devel] " Mike Snitzer
     [not found]   ` <CGME20220823121912eucas1p18223e1b04b65a8a10f6c50187e7474ea@eucas1p1.samsung.com>
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       ` Mike Snitzer
2022-09-02  0:17         ` [dm-devel] " Mike Snitzer
     [not found]   ` <CGME20220823121913eucas1p11c222f4c57a0132117bb9712e6018668@eucas1p1.samsung.com>
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       ` Mike Snitzer
2022-09-02  0:18         ` [dm-devel] " Mike Snitzer
     [not found]   ` <CGME20220823121914eucas1p2f4445066c23cdae4fca80f7b0268815b@eucas1p2.samsung.com>
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       ` Mike Snitzer
2022-09-02  0:28         ` [dm-devel] " Mike Snitzer
2022-09-02 12:02         ` Pankaj Raghav
2022-09-02 12:02           ` [dm-devel] " Pankaj Raghav
2022-09-02 18:43           ` Mike Snitzer
2022-09-02 18:43             ` [dm-devel] " Mike Snitzer
     [not found]   ` <CGME20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de@eucas1p1.samsung.com>
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       ` Shinichiro Kawasaki
2022-08-30  2:52         ` [dm-devel] " Shinichiro Kawasaki
2022-08-30 10:03         ` Pankaj Raghav
2022-08-30 10:03           ` Pankaj Raghav
2022-09-02 12:05       ` Pankaj Raghav
2022-09-02 12:05         ` [dm-devel] " Pankaj Raghav
2022-09-02 20:55       ` Mike Snitzer
2022-09-02 20:55         ` [dm-devel] " Mike Snitzer
2022-09-02 21:07         ` Mike Snitzer
2022-09-02 21:07           ` [dm-devel] " Mike Snitzer
2022-09-05 12:57           ` Pankaj Raghav [this message]
2022-09-05 12:57             ` Pankaj Raghav
2022-09-05 12:48         ` Pankaj Raghav
2022-09-05 12:48           ` [dm-devel] " 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=67726654-2c13-2c41-c002-30dc99db8497@samsung.com \
    --to=p.raghav@samsung.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=pankydev8@gmail.com \
    --cc=snitzer@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.