Re: [PATCH] dm: error: Add support for zoned block devices

2023-10-24 Thread Damien Le Moal
On 10/25/23 14:22, Naohiro Aota wrote: > On Tue, Oct 24, 2023 at 07:45:13AM +0900, Damien Le Moal wrote: >> dm-error is used in several test cases in the xfstests test suite to >> check the handling of IO errors in file syatems. Howeve

[PATCH] dm: error: Add support for zoned block devices

2023-10-23 Thread Damien Le Moal
() is also changed to return true. Signed-off-by: Damien Le Moal --- drivers/md/dm-table.c | 3 +++ drivers/md/dm-target.c | 42 -- drivers/md/dm-zone.c | 9 + 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-table.c b

Re: [dm-devel] [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-07-27 Thread Damien Le Moal
re code in many places instead of less code + a simple inline helper in the shrinker header file... So not adding that super simple helper is not exactly the best choice in my opinion. -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v13 3/9] block: add emulation for copy

2023-07-10 Thread Damien Le Moal
d 100644 > --- a/include/linux/blk_types.h > +++ b/include/linux/blk_types.h > @@ -562,4 +562,9 @@ struct cio { > atomic_t refcount; > }; > > +struct copy_ctx { > + struct cio *cio; > + struct work_struct dispatch_work; > + struct bio *write_bio; > +}; > #endif /* __LINUX_BLK_TYPES_H */ > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 963f5c97dec0..c176bf6173c5 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1047,6 +1047,9 @@ ssize_t blkdev_copy_offload( > struct block_device *bdev_in, loff_t pos_in, > struct block_device *bdev_out, loff_t pos_out, > size_t len, cio_iodone_t end_io, void *private, gfp_t gfp_mask); > +struct bio *bio_map_kern(struct request_queue *q, void *data, unsigned int > len, > + gfp_t gfp_mask); > +void bio_map_kern_endio(struct bio *bio); > > #define BLKDEV_ZERO_NOUNMAP (1 << 0) /* do not free blocks */ > #define BLKDEV_ZERO_NOFALLBACK (1 << 1) /* don't write explicit > zeroes */ -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v13 1/9] block: Introduce queue limits for copy-offload support

2023-07-10 Thread Damien Le Moal
+extern void blk_queue_max_copy_sectors_hw(struct request_queue *q, > + unsigned int max_copy_sectors); > void blk_queue_max_secure_erase_sectors(struct request_queue *q, > unsigned int max_sectors); > extern void blk_queue_max_segment_size(struct request_queue

Re: [dm-devel] [PATCH v13 4/9] fs, block: copy_file_range for def_blk_ops for direct block device

2023-07-10 Thread Damien Le Moal
nux/blkdev.h > index c176bf6173c5..850168cad080 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1047,6 +1047,10 @@ ssize_t blkdev_copy_offload( > struct block_device *bdev_in, loff_t pos_in, > struct block_device *bdev_out, loff_t

Re: [dm-devel] [PATCH v13 2/9] block: Add copy offload support infrastructure

2023-07-10 Thread Damien Le Moal
_MASK) == REQ_OP_COPY_SRC) || > + ((op & REQ_OP_MASK) == REQ_OP_COPY_DST)); > +} > + > /* > * Check if the bio or request is one that needs special treatment in the > * flush state machine. > @@ -541,4 +550,16 @@ struct blk_rq_stat { > u64 batch; > }; > > +

Re: [dm-devel] [PATCH v11 1/9] block: Introduce queue limits for copy-offload support

2023-05-22 Thread Damien Le Moal
ed int max_copy_sectors); > void blk_queue_max_secure_erase_sectors(struct request_queue *q, > unsigned int max_sectors); > extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); > @@ -1218,6 +1225,11 @@ static inline unsigned int > bdev_discard_g

Re: [dm-devel] Does dm-zoned support buffered write?

2023-05-15 Thread Damien Le Moal
0 >> root 1413640 0.0 0.0 13972 2496 pts/0S+ 01:31 0:00 >> grep mkfs.ext4 >> >> root@smr_dev:~# cat /proc/1411791/stack >> [<0>] wait_on_page_bit+0x133/0x270 >> [<0>] wait_on_page_writeback+0x25/0x70 >> [<0>] __filemap_fdatawait_ra

Re: [dm-devel] [PATCH 18/19] dm-crypt: check if adding pages to clone bio fails

2023-03-29 Thread Damien Le Moal
On 3/30/23 09:17, Yang Shi wrote: > On Wed, Mar 29, 2023 at 4:49 PM Damien Le Moal > wrote: >> >> On 3/30/23 02:06, Johannes Thumshirn wrote: >>> Check if adding pages to clone bio fails and if bail out. >> >> Nope. The code retries with direct r

Re: [dm-devel] [PATCH 19/19] block: mark bio_add_page as __must_check

2023-03-29 Thread Damien Le Moal
On 3/30/23 02:06, Johannes Thumshirn wrote: > Now that all users of bio_add_page check for the return value, mark > bio_add_page as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing l

Re: [dm-devel] [PATCH 18/19] dm-crypt: check if adding pages to clone bio fails

2023-03-29 Thread Damien Le Moal
annes Thumshirn With the commit message fixed, Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 17/19] md: raid1: check if adding pages to resync bio fails

2023-03-29 Thread Damien Le Moal
;*/ > - bio_add_page(bio, page, len, 0); > + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { Not sure we really need the WARN_ON here... Nevertheless, Reviewed-by: Damien Le Moal > + bio->bi_status = BLK_STS_RE

Re: [dm-devel] [PATCH 16/19] md: raid1: use __bio_add_page for adding single page to bio

2023-03-29 Thread Damien Le Moal
ranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 15/19] md: check for failure when adding pages in alloc_behind_master_bio

2023-03-29 Thread Damien Le Moal
gned-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 14/19] floppy: use __bio_add_page for adding single page to bio

2023-03-29 Thread Damien Le Moal
teed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 13/19] zram: use __bio_add_page for adding single page to bio

2023-03-29 Thread Damien Le Moal
ranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 12/19] zonefs: use __bio_add_page for adding single page to bio

2023-03-29 Thread Damien Le Moal
is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Acked-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 11/19] gfs: use __bio_add_page for adding single page to bio

2023-03-29 Thread Damien Le Moal
is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 10/19] jfs: logmgr: use __bio_add_page to add single page to bio

2023-03-29 Thread Damien Le Moal
teed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 09/19] btrfs: raid56: use __bio_add_page to add single page

2023-03-29 Thread Damien Le Moal
wly created bio is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.

Re: [dm-devel] [PATCH 08/19] btrfs: repair: use __bio_add_page for adding single page

2023-03-29 Thread Damien Le Moal
is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.

Re: [dm-devel] [PATCH 07/19] md: raid5: use __bio_add_page to add single page to new bio

2023-03-29 Thread Damien Le Moal
is allocated if adding the page fails. > > Use __bio_add_page() as adding a single page to a newly created bio is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le

Re: [dm-devel] [PATCH 05/19] md: use __bio_add_page to add single page

2023-03-29 Thread Damien Le Moal
is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.

Re: [dm-devel] [PATCH 06/19] md: raid5-log: use __bio_add_page to add single page

2023-03-29 Thread Damien Le Moal
wly created bio is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.

Re: [dm-devel] [PATCH 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page

2023-03-29 Thread Damien Le Moal
tep closer to marking bio_add_page() __must_check > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 04/19] fs: buffer: use __bio_add_page to add single page to bio

2023-03-29 Thread Damien Le Moal
is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 02/19] drbd: use __bio_add_page to add page to bio

2023-03-29 Thread Damien Le Moal
gned-off-by: Johannes Thumshirn With Matthew comment addressed, Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 01/19] swap: use __bio_add_page to add page to bio

2023-03-29 Thread Damien Le Moal
gned-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v8 1/9] block: Introduce queue limits for copy-offload support

2023-03-29 Thread Damien Le Moal
Copy >>> + requests issued to the device must not exceed this limit. >>> + A value of 0 means that the device does not >>> + support copy offload. >> >> [RO] This is the maximum number of kilobytes supported in a >>

Re: [dm-devel] [PATCH v8 9/9] null_blk: add support for copy offload

2023-03-29 Thread Damien Le Moal
On 3/27/23 17:40, Anuj Gupta wrote: > From: Nitesh Shetty > > Implementaion is based on existing read and write infrastructure. > > Suggested-by: Damien Le Moal > Signed-off-by: Anuj Gupta > Signed-off-by: Nitesh Shetty > Signed-off-by: Vincent Fu > --- >

Re: [dm-devel] [PATCH v8 7/9] dm: Add support for copy offload.

2023-03-29 Thread Damien Le Moal
stance (verified in dm_poll_dm_io) > diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h > index 7975483816e4..44969a20295e 100644 > --- a/include/linux/device-mapper.h > +++ b/include/linux/device-mapper.h > @@ -380,6 +380,11 @@ struct dm_target { >

Re: [dm-devel] [PATCH v8 2/9] block: Add copy offload support infrastructure

2023-03-29 Thread Damien Le Moal
ct blk_rq_stat { > u64 batch; > }; > > +typedef void (cio_iodone_t)(void *private, int comp_len); Not really needed I think. > + > +struct cio { > + struct task_struct *waiter; /* waiting task (NULL if none) */ > + atomic_t refcount; > + loff_t p

Re: [dm-devel] [PATCH v8 1/9] block: Introduce queue limits for copy-offload support

2023-03-29 Thread Damien Le Moal
ors: maximum number of sectors to copy > + **/ > +void blk_queue_max_copy_sectors_hw(struct request_queue *q, > + unsigned int max_copy_sectors) > +{ > + if (max_copy_sectors >= MAX_COPY_TOTAL_LENGTH) Confusing name as LENGTH may be interpreted as bytes. MAX_COPY

Re: [dm-devel] [PATCH 4/7] zonefs: use bdev_zone_no helper to calculate the zone index

2023-01-06 Thread Damien Le Moal
dex 1dbe78119ff1..703bc4505b29 100644 > --- a/fs/zonefs/zonefs.h > +++ b/fs/zonefs/zonefs.h > @@ -179,7 +179,6 @@ struct zonefs_sb_info { > kgid_t s_gid; > umode_t s_perm; > uuid_t s_uuid; > - unsigned ints_zone_sectors_shift; > > unsigned ints_nr_files[ZONEFS_ZTYPE_MAX]; > -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 3/7] nvmet: introduce bdev_zone_no helper

2023-01-06 Thread Damien Le Moal
let's us > make modifications to the math if needed in one place. > > Signed-off-by: Pankaj Raghav Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 1/7] block: remove superfluous check for request queue in bdev_is_zoned

2023-01-06 Thread Damien Le Moal
eue(bdev)); > } > > static inline bool bdev_op_is_zoned_write(struct block_device *bdev, Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 2/7] block: add a new helper bdev_{is_zone_start, offset_from_zone_start}

2023-01-06 Thread Damien Le Moal
if (!bdev_is_zoned(bdev)) > + return false; Same here. > + > + return bdev_offset_from_zone_start(bdev, sec) == 0; > +} > + > static inline int queue_dma_alignment(const struct request_queue *q) > { > return q ? q->limits.dma_alignment : 511; -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v5 10/10] fs: add support for copy file range in zonefs

2022-11-30 Thread Damien Le Moal
On 11/30/22 13:17, Nitesh Shetty wrote: > On Wed, Nov 30, 2022 at 08:45:55AM +0900, Damien Le Moal wrote: >> On 11/29/22 21:22, Nitesh Shetty wrote: >>> Acked. I do see a gap in current zonefs cfr implementation. I will drop this >> >> cfr ? >> > > yes,

Re: [dm-devel] [PATCH v5 10/10] fs: add support for copy file range in zonefs

2022-11-29 Thread Damien Le Moal
k you, > Nitesh Please trim your replies. -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v5 10/10] fs: add support for copy file range in zonefs

2022-11-23 Thread Damien Le Moal
On 11/24/22 10:32, Damien Le Moal wrote: > On 11/23/22 14:58, Nitesh Shetty wrote: >> copy_file_range is implemented using copy offload, >> copy offloading to device is always enabled. >> To disable copy offloading mount with "no_copy_offload" mount option. >

Re: [dm-devel] [PATCH v5 10/10] fs: add support for copy file range in zonefs

2022-11-23 Thread Damien Le Moal
flags); > + return ret; > +} > + > static const struct file_operations zonefs_file_operations = { > .open = zonefs_file_open, > .release= zonefs_file_release, > @@ -1234,6 +1411,7 @@ static const struct file_operations > zonefs_file_operations = { > .splice_read= generic_file_splice_read, > .splice_write = iter_file_splice_write, > .iopoll = iocb_bio_iopoll, > + .copy_file_range = zonefs_copy_file_range, > }; > > static struct kmem_cache *zonefs_inode_cachep; > @@ -1804,6 +1982,7 @@ static int zonefs_fill_super(struct super_block *sb, > void *data, int silent) > atomic_set(>s_active_seq_files, 0); > sbi->s_max_active_seq_files = bdev_max_active_zones(sb->s_bdev); > > + /* set copy support by default */ What is this comment supposed to be for ? > ret = zonefs_read_super(sb); > if (ret) > return ret; -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v15 00/13] support zoned block devices with non-power-of-2 zone sizes

2022-09-30 Thread Damien Le Moal
e any extent span zone boundaries. So personally, I do not consider such argument as a valid justification for the non-power-of-2 zone size support. > > Thanks, > > Bart. > > -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] Please further explain Linux's "zoned storage" roadmap [was: Re: [PATCH v14 00/13] support zoned block devices with non-power-of-2 zone sizes]

2022-09-22 Thread Damien Le Moal
On 9/23/22 04:37, Mike Snitzer wrote: > On Wed, Sep 21 2022 at 7:55P -0400, > Damien Le Moal wrote: > >> On 9/22/22 02:27, Mike Snitzer wrote: >>> On Tue, Sep 20 2022 at 5:11P -0400, >>> Pankaj Raghav wrote: >>> >>>> - Background and

Re: [dm-devel] Please further explain Linux's "zoned storage" roadmap [was: Re: [PATCH v14 00/13] support zoned block devices with non-power-of-2 zone sizes]

2022-09-21 Thread Damien Le Moal
l evaluating its potential use cases. We also have a different but functionally equivalent approach implemented as a block device driver that we are evaluating internally. Given the above mentioned usage pattern we have seen so far for zoned storage, it is not yet clear if something like dm-zap for ZNS is neede

Re: [dm-devel] [PATCH 1/1] dm crypt: Add inline encryption support

2022-01-14 Thread Damien Le Moal
-- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH] dm: fix dm_revalidate_zones() memory allocation

2021-06-18 Thread Damien Le Moal
using memalloc_noio_save/restore calls. Reported-by: Dan Carpenter Fixes: bb37d77239af ("dm: introduce zone append emulation") Signed-off-by: Damien Le Moal --- drivers/md/dm-zone.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-zone.c b/

Re: [dm-devel] [PATCH v5 08/11] dm: Forbid requeue of writes to zones

2021-06-04 Thread Damien Le Moal
On 2021/06/04 23:56, Mike Snitzer wrote: > On Tue, May 25 2021 at 5:24P -0400, > Damien Le Moal wrote: > >> A target map method requesting the requeue of a bio with >> DM_MAPIO_REQUEUE or completing it with DM_ENDIO_REQUEUE can cause >> unaligned write errors if t

[dm-devel] [PATCH] dm: fix uninitialized variable use

2021-06-04 Thread Damien Le Moal
From: Damien Le Moal In dm_io_dec_pending(), make sure that the bio variable is initialized to io->orig_bio before using it. Reported-by: kernel test robot Fixes: 3a1e343c53ae ("dm: Forbid requeue of writes to zones") Signed-off-by: Damien Le Moal --- drivers/md/dm.c | 4 ++-- 1

Re: [dm-devel] dm: Forbid requeue of writes to zones

2021-06-03 Thread Damien Le Moal
On 2021/06/04 7:17, Colin Ian King wrote: > Hi, > > Static analysis with Coverity on Linux next has found and issue in > drivers/md/dm.c with the following commit: > > commit 2c243153d1d4be4e23735cd10984ac17c7a54531 > Author: Damien Le Moal > Date: Wed May 26 06:24:5

Re: [dm-devel] [PATCH v5 00/11] dm: Improve zoned block device support

2021-06-03 Thread Damien Le Moal
On 2021/06/04 7:16, Mike Snitzer wrote: > On Thu, Jun 03 2021 at 1:46P -0400, > Jens Axboe wrote: > >> On 6/2/21 12:32 PM, Mike Snitzer wrote: >>> On Tue, Jun 01 2021 at 6:57P -0400, >>> Damien Le Moal wrote: >>> >>>> On 2021/05/26 6:25,

Re: [dm-devel] [dm:for-next 20/20] drivers/md/dm.c:850:43: warning: variable 'bio' is uninitialized when used here

2021-06-02 Thread Damien Le Moal
* without REQ_PREFLUSH. >874 */ >875bio->bi_opf &= ~REQ_PREFLUSH; >876queue_io(md, bio); >877} else { >878 /*

Re: [dm-devel] [PATCH v5 00/11] dm: Improve zoned block device support

2021-06-01 Thread Damien Le Moal
On 2021/05/26 6:25, Damien Le Moal wrote: > This series improve device mapper support for zoned block devices and > of targets exposing a zoned device. Mike, Jens, Any feedback regarding this series ? > > The first patch improve support for user requests to reset all zones of

Re: [dm-devel] [PATCH] dm zoned: check zone capacity

2021-05-28 Thread Damien Le Moal
On 2021/05/19 10:26, Damien Le Moal wrote: > The dm-zoned target cannot support zoned block devices with zones that > have a capacity smaller than the zone size (e.g. NVMe zoned namespaces) > due to the current chunk zone mapping implementation as it is assumed > that zones and

Re: [dm-devel] [PATCH v2] dm-kcopyd: avoid useless atomic operations

2021-05-26 Thread Damien Le Moal
On 2021/05/26 23:16, Mikulas Patocka wrote: > > > On Tue, 25 May 2021, Damien Le Moal wrote: > >> On 2021/05/26 4:50, Mikulas Patocka wrote: >>> The functions set_bit and clear_bit are atomic. We don't need atomicity >>> when making flags for dm-kcopyd. So

Re: [dm-devel] [PATCH] dm-kcopyd avoid spin_lock_irqsave from process context

2021-05-26 Thread Damien Le Moal
ed-off-by: Mikulas Patocka Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH] dm-kcopyd: avoid useless atomic operations

2021-05-25 Thread Damien Le Moal
< end_block) { > if (src_zone->dev->flags & DMZ_BDEV_DYING) > > -- > dm-devel mailing list > dm-devel@redhat.com > https://listman.redhat.com/mailman/listinfo/dm-devel Either way, looks fine to me. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH v5 06/11] dm: move zone related code to dm-zone.c

2021-05-25 Thread Damien Le Moal
request queue zone attributes in dm_table_set_restrictions(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani --- drivers/md/Makefile | 4 ++ drivers/md/dm-table.c | 14 ++ drivers/md/dm-zone.c | 102

[dm-devel] [PATCH v5 00/11] dm: Improve zoned block device support

2021-05-25 Thread Damien Le Moal
to remove the request_queue argument * Improve patch 3 commit message as suggested by Christoph (explaining that the flag is a special case that cannot use a REQ_XXX flag) * Changed DMWARN() into DMDEBUG in patch 11 as suggested by Milan * Added reviewed-by tags Damien Le Moal (11): block

[dm-devel] [PATCH v5 11/11] dm crypt: Fix zoned block device support

2021-05-25 Thread Damien Le Moal
resulting in an IV mismatch between encryption and decryption. To solve this problem, report to DM core that zone append operations are not supported. This result in the zone append operations being emulated using regular write operations. Reported-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le

[dm-devel] [PATCH v5 04/11] dm: Fix dm_accept_partial_bio()

2021-05-25 Thread Damien Le Moal
() calls to make the code more legible. Signed-off-by: Damien Le Moal --- drivers/md/dm.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ca2aedd8ee7d..11af20080639 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1237,8 +1237,8

[dm-devel] [PATCH v5 10/11] dm: introduce zone append emulation

2021-05-25 Thread Damien Le Moal
operations. Regular device targets are also not affected. The added code also does not impact builds with CONFIG_BLK_DEV_ZONED disabled by stubbing out all dm zone related functions. Signed-off-by: Damien Le Moal Reviewed-by: Himanshu Madhani --- drivers/md/dm-core.h | 13 + drivers

[dm-devel] [PATCH v5 05/11] dm: cleanup device_area_is_invalid()

2021-05-25 Thread Damien Le Moal
In device_area_is_invalid(), use bdev_is_zoned() instead of open coding the test on the zoned model returned by bdev_zoned_model(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Himanshu Madhani

[dm-devel] [PATCH v5 09/11] dm: rearrange core declarations

2021-05-25 Thread Damien Le Moal
of the function names, introduce the inline helper dm_io_inc_pending() instead of directly using atomic_inc() calls. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani --- drivers/md/dm-core.h | 52 ++ drivers/md/dm.c | 59

[dm-devel] [PATCH v5 03/11] block: introduce BIO_ZONE_WRITE_LOCKED bio flag

2021-05-25 Thread Damien Le Moal
. This avoids conflicts down the stack with the block IO scheduler zone write locking (in mq-deadline). Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Reviewed-by: Himanshu Madhani --- include/linux/blk_types.h | 1 + 1 file

[dm-devel] [PATCH v5 08/11] dm: Forbid requeue of writes to zones

2021-05-25 Thread Damien Le Moal
dm_is_zone_write() is introduced to detect write operations to zoned targets. This change does not affect the target drivers supporting zoned devices and exposing a zoned device, namely dm-crypt, dm-linear and dm-flakey as none of these targets ever request a requeue. Signed-off-by: Damien Le Moal

[dm-devel] [PATCH v5 07/11] dm: Introduce dm_report_zones()

2021-05-25 Thread Damien Le Moal
dm_report_zones_cb() is not. dm-linear, dm-flakey and dm-crypt are modified to use dm_report_zones(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani --- drivers/md/dm-crypt.c | 7 +++ drivers/md/dm-flakey.c

[dm-devel] [PATCH v5 01/11] block: improve handling of all zones reset operation

2021-05-25 Thread Damien Le Moal
. 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

[dm-devel] [PATCH v5 02/11] block: introduce bio zone helpers

2021-05-25 Thread Damien Le Moal
Introduce the helper functions bio_zone_no() and bio_zone_is_seq(). Both are the BIO counterparts of the request helpers blk_rq_zone_no() and blk_rq_zone_is_seq(), respectively returning the number of the target zone of a bio and true if the BIO target zone is sequential. Signed-off-by: Damien Le

Re: [dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-25 Thread Damien Le Moal
On 2021/05/25 15:15, Chaitanya Kulkarni wrote: > On 5/24/21 7:25 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_ZON

[dm-devel] [PATCH v4 03/11] block: introduce BIO_ZONE_WRITE_LOCKED bio flag

2021-05-24 Thread Damien Le Moal
. This avoids conflicts down the stack with the block IO scheduler zone write locking (in mq-deadline). Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni --- include/linux/blk_types.h | 1 + 1 file changed, 1 insertion(+) diff

[dm-devel] [PATCH v4 05/11] dm: cleanup device_area_is_invalid()

2021-05-24 Thread Damien Le Moal
In device_area_is_invalid(), use bdev_is_zoned() instead of open coding the test on the zoned model returned by bdev_zoned_model(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm-table.c | 2 +- 1 file changed, 1 insertion(+), 1

[dm-devel] [PATCH v4 07/11] dm: Introduce dm_report_zones()

2021-05-24 Thread Damien Le Moal
dm_report_zones_cb() is not. dm-linear, dm-flakey and dm-crypt are modified to use dm_report_zones(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm-crypt.c | 7 +++ drivers/md/dm-flakey.c| 7 +++ drivers/md/dm

[dm-devel] [PATCH v4 09/11] dm: rearrange core declarations

2021-05-24 Thread Damien Le Moal
of the function names, introduce the inline helper dm_io_inc_pending() instead of directly using atomic_inc() calls. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- drivers/md/dm-core.h | 52 ++ drivers/md/dm.c | 59

[dm-devel] [PATCH v4 08/11] dm: Forbid requeue of writes to zones

2021-05-24 Thread Damien Le Moal
dm_is_zone_write() is introduced to detect write operations to zoned targets. This change does not affect the target drivers supporting zoned devices and exposing a zoned device, namely dm-crypt, dm-linear and dm-flakey as none of these targets ever request a requeue. Signed-off-by: Damien Le Moal

[dm-devel] [PATCH v4 10/11] dm: introduce zone append emulation

2021-05-24 Thread Damien Le Moal
operations. Regular device targets are also not affected. The added code also does not impact builds with CONFIG_BLK_DEV_ZONED disabled by stubbing out all dm zone related functions. Signed-off-by: Damien Le Moal --- drivers/md/dm-core.h | 13 + drivers/md/dm-table.c | 19

[dm-devel] [PATCH v4 11/11] dm crypt: Fix zoned block device support

2021-05-24 Thread Damien Le Moal
resulting in an IV mismatch between encryption and decryption. To solve this problem, report to DM core that zone append operations are not supported. This result in the zone append operations being emulated using regular write operations. Reported-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le

[dm-devel] [PATCH v4 04/11] dm: Fix dm_accept_partial_bio()

2021-05-24 Thread Damien Le Moal
() calls to make the code more legible. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ca2aedd8ee7d..a9211575bfed 100644

[dm-devel] [PATCH v4 06/11] dm: move zone related code to dm-zone.c

2021-05-24 Thread Damien Le Moal
request queue zone attributes in dm_table_set_restrictions(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/Makefile | 4 ++ drivers/md/dm-table.c | 14 ++ drivers/md/dm-zone.c | 102

[dm-devel] [PATCH v4 02/11] block: introduce bio zone helpers

2021-05-24 Thread Damien Le Moal
Introduce the helper functions bio_zone_no() and bio_zone_is_seq(). Both are the BIO counterparts of the request helpers blk_rq_zone_no() and blk_rq_zone_is_seq(), respectively returning the number of the target zone of a bio and true if the BIO target zone is sequential. Signed-off-by: Damien Le

[dm-devel] [PATCH v4 01/11] block: improve handling of all zones reset operation

2021-05-24 Thread Damien Le Moal
. 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

[dm-devel] [PATCH v4 00/11] dm: Improve zoned block device support

2021-05-24 Thread Damien Le Moal
) * Changed DMWARN() into DMDEBUG in patch 11 as suggested by Milan * Added reviewed-by tags Damien Le Moal (11): block: improve handling of all zones reset operation block: introduce bio zone helpers block: introduce BIO_ZONE_WRITE_LOCKED bio flag dm: Fix dm_accept_partial_bio() dm: cleanup

[dm-devel] [PATCH v3 04/11] dm: Fix dm_accept_partial_bio()

2021-05-20 Thread Damien Le Moal
() calls to make the code more legible. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ca2aedd8ee7d..a9211575bfed 100644

[dm-devel] [PATCH v3 05/11] dm: cleanup device_area_is_invalid()

2021-05-20 Thread Damien Le Moal
In device_area_is_invalid(), use bdev_is_zoned() instead of open coding the test on the zoned model returned by bdev_zoned_model(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm-table.c | 2 +- 1 file changed, 1 insertion(+), 1

[dm-devel] [PATCH v3 11/11] dm crypt: Fix zoned block device support

2021-05-20 Thread Damien Le Moal
resulting in an IV mismatch between encryption and decryption. To solve this problem, report to DM core that zone append operations are not supported. This result in the zone append operations being emulated using regular write operations. Reported-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le

[dm-devel] [PATCH v3 09/11] dm: rearrange core declarations

2021-05-20 Thread Damien Le Moal
of the function names, introduce the inline helper dm_io_inc_pending() instead of directly using atomic_inc() calls. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- drivers/md/dm-core.h | 52 ++ drivers/md/dm.c | 59

[dm-devel] [PATCH v3 10/11] dm: introduce zone append emulation

2021-05-20 Thread Damien Le Moal
operations. Regular device targets are also not affected. The added code also does not impact builds with CONFIG_BLK_DEV_ZONED disabled by stubbing out all dm zone related functions. Signed-off-by: Damien Le Moal --- drivers/md/dm-core.h | 13 + drivers/md/dm-table.c | 19

[dm-devel] [PATCH v3 01/11] block: improve handling of all zones reset operation

2021-05-20 Thread Damien Le Moal
. 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

[dm-devel] [PATCH v3 02/11] block: introduce bio zone helpers

2021-05-20 Thread Damien Le Moal
Introduce the helper functions bio_zone_no() and bio_zone_is_seq(). Both are the BIO counterparts of the request helpers blk_rq_zone_no() and blk_rq_zone_is_seq(), respectively returning the number of the target zone of a bio and true if the BIO target zone is sequential. Signed-off-by: Damien Le

[dm-devel] [PATCH v3 07/11] dm: Introduce dm_report_zones()

2021-05-20 Thread Damien Le Moal
dm_report_zones_cb() is not. dm-linear, dm-flakey and dm-crypt are modified to use dm_report_zones(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/dm-crypt.c | 7 +++ drivers/md/dm-flakey.c| 7 +++ drivers/md/dm

[dm-devel] [PATCH v3 08/11] dm: Forbid requeue of writes to zones

2021-05-20 Thread Damien Le Moal
dm_is_zone_write() is introduced to detect write operations to zoned targets. This change does not affect the target drivers supporting zoned devices and exposing a zoned device, namely dm-crypt, dm-linear and dm-flakey as none of these targets ever request a requeue. Signed-off-by: Damien Le Moal

[dm-devel] [PATCH v3 00/11] dm: Improve zoned block device support

2021-05-20 Thread Damien Le Moal
argument * Improve patch 3 commit message as suggested by Christoph (explaining that the flag is a special case that cannot use a REQ_XXX flag) * Changed DMWARN() into DMDEBUG in patch 11 as suggested by Milan * Added reviewed-by tags Damien Le Moal (11): block: improve handling of all zones

[dm-devel] [PATCH v3 06/11] dm: move zone related code to dm-zone.c

2021-05-20 Thread Damien Le Moal
request queue zone attributes in dm_table_set_restrictions(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke --- drivers/md/Makefile | 4 ++ drivers/md/dm-table.c | 14 ++ drivers/md/dm-zone.c | 102

[dm-devel] [PATCH v3 03/11] block: introduce BIO_ZONE_WRITE_LOCKED bio flag

2021-05-20 Thread Damien Le Moal
. This avoids conflicts down the stack with the block IO scheduler zone write locking (in mq-deadline). Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- include/linux/blk_types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blk_types.h

Re: [dm-devel] [PATCH v2 10/11] dm: introduce zone append emulation

2021-05-20 Thread Damien Le Moal
On 2021/05/20 15:47, Hannes Reinecke wrote: > On 5/20/21 8:25 AM, Damien Le Moal wrote: >> On 2021/05/20 15:10, Hannes Reinecke wrote: >> [...] >>>> +/* >>>> + * First phase of BIO mapping for targets with zone append emulation: >>>> + * check a

Re: [dm-devel] [PATCH v2 10/11] dm: introduce zone append emulation

2021-05-20 Thread Damien Le Moal
*/ >> +if (!bio_flagged(clone, BIO_ZONE_WRITE_LOCKED)) >> +return; >> + >> +zno = bio_zone_no(orig_bio); >> + >> +spin_lock_irqsave(>zwp_offset_lock, flags); >> +if (clone->bi_status != BLK_STS_OK) { >> + /* >> + * BIOs t

[dm-devel] [PATCH v2 11/11] dm crypt: Fix zoned block device support

2021-05-19 Thread Damien Le Moal
resulting in an IV mismatch between encryption and decryption. To solve this problem, report to DM core that zone append operations are not supported. This result in the zone append operations being emulated using regular write operations. Reported-by: Shin'ichiro Kawasaki Signed-off-by: Damien Le

[dm-devel] [PATCH v2 04/11] dm: Fix dm_accept_partial_bio()

2021-05-19 Thread Damien Le Moal
() calls to make the code more legible. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- drivers/md/dm.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ca2aedd8ee7d..a9211575bfed 100644 --- a/drivers/md/dm.c +++ b

[dm-devel] [PATCH v2 06/11] dm: move zone related code to dm-zone.c

2021-05-19 Thread Damien Le Moal
request queue zone attributes in dm_table_set_restrictions(). Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- drivers/md/Makefile | 4 ++ drivers/md/dm-table.c | 14 ++ drivers/md/dm-zone.c | 102 ++ drivers/md/dm.c | 78

[dm-devel] [PATCH v2 02/11] block: introduce bio zone helpers

2021-05-19 Thread Damien Le Moal
Introduce the helper functions bio_zone_no() and bio_zone_is_seq(). Both are the BIO counterparts of the request helpers blk_rq_zone_no() and blk_rq_zone_is_seq(), respectively returning the number of the target zone of a bio and true if the BIO target zone is sequential. Signed-off-by: Damien Le

  1   2   3   4   5   6   >