[dm-devel] [PATCH 11/19] rnbd-srv: remove struct rnbd_dev_blk_io

2022-01-24 Thread Christoph Hellwig
Only the priv field of rnbd_dev_blk_io is used, so store the value of that in bio->bi_private directly and remove the entire bio_set overhead. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-srv-dev.c | 4 +--- drivers/block/rnbd/rnbd-srv-dev.h | 13 ++--- drivers/bl

[dm-devel] [PATCH 12/19] xen-blkback: bio_alloc can't fail if it is allow to sleep

2022-01-24 Thread Christoph Hellwig
Remove handling of NULL returns from sleeping bio_alloc calls given that those can't fail. Signed-off-by: Christoph Hellwig --- drivers/block/xen-blkback/blkback.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-bl

[dm-devel] [PATCH 06/19] dm-crypt: remove clone_init

2022-01-24 Thread Christoph Hellwig
Just open code it next to the bio allocations, which saves a few lines of code, prepares for future changes and allows to remove the duplicate bi_opf assignment for the bio_clone_fast case in kcryptd_io_read. Signed-off-by: Christoph Hellwig --- drivers/md/dm-crypt.c | 21

[dm-devel] [PATCH 16/19] block: pass a block_device and opf to bio_alloc_kiocb

2022-01-24 Thread Christoph Hellwig
Pass the block_device and operation that we plan to use this bio for to bio_alloc_kiocb to optimize the assigment. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- block/bio.c | 12 block/fops.c| 17 - include/linux/bio.h | 4

[dm-devel] [PATCH 02/19] nilfs2: remove nilfs_alloc_seg_bio

2022-01-24 Thread Christoph Hellwig
bio_alloc will never fail when it can sleep. Remove the now simple nilfs_alloc_seg_bio helper and open code it in the only caller. Signed-off-by: Christoph Hellwig --- fs/nilfs2/segbuf.c | 31 --- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/fs

[dm-devel] [PATCH 13/19] block: move blk_next_bio to bio.c

2022-01-24 Thread Christoph Hellwig
Keep blk_next_bio next to the core bio infrastructure. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- block/bio.c | 13 + block/blk-lib.c | 13 - 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block/bio.c b/block/bio.c index

[dm-devel] [PATCH 15/19] block: pass a block_device and opf to bio_alloc_bioset

2022-01-24 Thread Christoph Hellwig
argument for a much more logical calling convention matching what most of the kernel does. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- block/bio.c | 30 + block/bounce.c | 6 ++ drivers/block

[dm-devel] [PATCH 18/19] block: pass a block_device and opf to bio_init

2022-01-24 Thread Christoph Hellwig
Pass the block_device that we plan to use this bio for and the operation to bio_init to optimize the assignment. A NULL block_device can be passed, both for the passthrough case on a raw request_queue and to temporarily avoid refactoring some nasty code. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 19/19] block: pass a block_device and opf to bio_reset

2022-01-24 Thread Christoph Hellwig
Pass the block_device that we plan to use this bio for and the operation to bio_reset to optimize the assigment. A NULL block_device can be passed, both for the passthrough case on a raw request_queue and to temporarily avoid refactoring some nasty code. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 17/19] block: pass a block_device and opf to bio_alloc

2022-01-24 Thread Christoph Hellwig
argument for a much more logical calling convention matching what most of the kernel does. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- block/bio.c | 5 + block/fops.c| 4 +--- drivers/block/drbd/drbd_receiver.c | 10

[dm-devel] [PATCH 11/14] block: clone crypto and integrity data in __bio_clone_fast

2022-01-26 Thread Christoph Hellwig
the other callers also don't need to handle failure, as the integrity and crypto clones are based on mempool allocations that won't fail for sleeping allocations. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 1 - block/bio.c

[dm-devel] [PATCH 01/14] drbd: set ->bi_bdev in drbd_req_new

2022-01-26 Thread Christoph Hellwig
Make sure the newly allocated bio has the correct bi_bdev set from the start. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_req.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index

[dm-devel] [PATCH 04/14] dm: fold __send_duplicate_bios into __clone_and_map_simple_bio

2022-01-26 Thread Christoph Hellwig
Fold __send_duplicate_bios into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e1356a4ce0393..b3b60918206b5

[dm-devel] [PATCH 12/14] dm: use bio_clone_fast in alloc_tio

2022-01-26 Thread Christoph Hellwig
Replace an open coded bio_clone_fast with the actual helper. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5978cb87e9372..984ccafb11ea8 100644 --- a/drivers/md/dm.c +++ b

[dm-devel] [PATCH 07/14] dm: retun the clone bio from alloc_tio

2022-01-26 Thread Christoph Hellwig
Return the clone bio embedded into the tio as that is what the callers actually want. Similar for the free side. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/md/dm.c b

[dm-devel] [PATCH 06/14] dm: pass the bio instead of tio to __map_bio

2022-01-26 Thread Christoph Hellwig
This simplifies the callers a bit. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f00c0582a2460..7cc477b2b77e9 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c

[dm-devel] [PATCH 02/14] dm: add a clone_to_tio helper

2022-01-26 Thread Christoph Hellwig
Add a helper to stop open coding the container_of operations to get from the clone bio to the tio structure. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md

[dm-devel] [PATCH 05/14] dm: move cloning the bio into alloc_tio

2022-01-26 Thread Christoph Hellwig
Move the call to __bio_clone_fast and the assignment of ->len_ptr from the callers into alloc_tio to prepare for changes to the bio clone API. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --gi

[dm-devel] [PATCH 14/14] block: pass a block_device to bio_clone_fast

2022-01-26 Thread Christoph Hellwig
Pass a block_device to bio_clone_fast and __bio_clone_fast and give the functions more suitable names. Signed-off-by: Christoph Hellwig --- Documentation/block/biodoc.rst | 5 - block/bio.c | 31 + block/blk-mq.c | 4

[dm-devel] [PATCH 03/14] dm: fold clone_bio into __clone_and_map_data_bio

2022-01-26 Thread Christoph Hellwig
Fold clone_bio into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 692a06156c927

[dm-devel] [PATCH 13/14] block: initialize the target bio in __bio_clone_fast

2022-01-26 Thread Christoph Hellwig
All callers of __bio_clone_fast initialize the bio first. Move that initialization into __bio_clone_fast instead. Signed-off-by: Christoph Hellwig --- block/bio.c | 75 - drivers/md/bcache/request.c | 1 - drivers/md/dm.c | 5

[dm-devel] [PATCH 10/14] dm-cache: remove __remap_to_origin_clear_discard

2022-01-26 Thread Christoph Hellwig
Fold __remap_to_origin_clear_discard into the two callers to prepare for bio cloning refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm-cache-target.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/md/dm-cache-target.c b

[dm-devel] improve the bio cloning interface

2022-01-26 Thread Christoph Hellwig
Hi Jens, this series changes the bio cloning interface to match the rest changes to the bio allocation interface and passes the block_device and operation to the cloning helpers. In addition it renames the cloning helpers to be more descriptive. To get there it requires a bit of refactoring in t

[dm-devel] [PATCH 09/14] dm: add a missing bio initialization to alloc_tio

2022-01-26 Thread Christoph Hellwig
The bio in the tio embedded into the clone_info structure is never initialized. This is harmless as bio_init only zeroes the structure and assigns the vectors, but add the initialization to prepare for refactoring the bio cloning logic. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 1

[dm-devel] [PATCH 08/14] dm: simplify the single bio fast path in __send_duplicate_bios

2022-01-26 Thread Christoph Hellwig
Most targets just need a single flush bio. Open code that case in __send_duplicate_bios without the need to add the bio to a list. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/md

Re: [dm-devel] improve the bio cloning interface

2022-01-27 Thread Christoph Hellwig
On Thu, Jan 27, 2022 at 11:52:51AM -0500, Mike Snitzer wrote: > I'd like to take a closer look, do you happen to have this series > available in a git branch? git://git.infradead.org/users/hch/block.git bio_alloc-cleanup-part2 > > The changes generally look fine. Any chance you could forecast w

Re: [dm-devel] [PATCH 1/3] block: add __bio_start_io_acct() to control start_time

2022-01-27 Thread Christoph Hellwig
> -static unsigned long __part_start_io_acct(struct block_device *part, > - unsigned int sectors, unsigned int op) > +static void __part_start_io_acct(struct block_device *part, unsigned int > sectors, > + unsigned int op, unsigned

Re: [dm-devel] [PATCH v3 1/3] block: add bio_start_io_acct_time() to control start_time

2022-01-27 Thread Christoph Hellwig
p(bio)); > + return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), > + bio_op(bio), jiffies); Is droppingthe READ_ONCE safe here? This is a honest question as these helpers still confuse me. The rest looks good: Reviewed-by: Christoph Hel

Re: [dm-devel] [PATCH v3 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-27 Thread Christoph Hellwig
dividual IO stats in response to a bio_split() that follows bio > submission. Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [PATCH v5 1/7] mce: fix set_mce_nospec to always unmap the whole page

2022-02-02 Thread Christoph Hellwig
> +static inline int set_mce_nospec(unsigned long pfn) > { > unsigned long decoy_addr; > int rc; > @@ -117,10 +113,7 @@ static inline int set_mce_nospec(unsigned long pfn, bool > unmap) >*/ > decoy_addr = (pfn << PAGE_SHIFT) + (PAGE_OFFSET ^ BIT(63)); > > - if (unm

Re: [PATCH v5 2/7] dax: introduce dax device flag DAXDEV_RECOVERY

2022-02-02 Thread Christoph Hellwig
On Fri, Jan 28, 2022 at 02:31:45PM -0700, Jane Chu wrote: > +int dax_prep_recovery(struct dax_device *dax_dev, void **kaddr) > +{ > + if (dax_recovery_capable(dax_dev)) { > + set_bit(DAXDEV_RECOVERY, (unsigned long *)kaddr); > + return 0; > + } > + return -EINVAL

Re: [PATCH v5 7/7] pmem: fix pmem_do_write() avoid writing to 'np' page

2022-02-02 Thread Christoph Hellwig
On Fri, Jan 28, 2022 at 02:31:50PM -0700, Jane Chu wrote: > + if (!bad_pmem) { > write_pmem(pmem_addr, page, page_off, len); > + } else { > + rc = pmem_clear_poison(pmem, pmem_off, len); > + if (rc == BLK_STS_OK) > + write_pmem(pmem_

Re: [PATCH v5 4/7] dax: add dax_recovery_write to dax_op and dm target type

2022-02-02 Thread Christoph Hellwig
On Fri, Jan 28, 2022 at 02:31:47PM -0700, Jane Chu wrote: > dax_recovery_write() dax op is only required for DAX device that > export DAXDEV_RECOVERY indicating its capability to recover from > poisons. > > DM may be nested, if part of the base dax devices forming a DM > device support dax recover

Re: [PATCH v5 5/7] pmem: add pmem_recovery_write() dax op

2022-02-02 Thread Christoph Hellwig
> @@ -257,10 +263,15 @@ static int pmem_rw_page(struct block_device *bdev, > sector_t sector, > __weak long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff, > long nr_pages, void **kaddr, pfn_t *pfn) > { > + bool bad_pmem; > + bool do_recovery = false; >

Re: [PATCH v5 6/7] dax: add recovery_write to dax_iomap_iter in failure path

2022-02-02 Thread Christoph Hellwig
On Fri, Jan 28, 2022 at 02:31:49PM -0700, Jane Chu wrote: > +typedef size_t (*iter_func_t)(struct dax_device *dax_dev, pgoff_t pgoff, > + void *addr, size_t bytes, struct iov_iter *i); > static loff_t dax_iomap_iter(const struct iomap_iter *iomi, > struct iov_iter *iter)

Re: [dm-devel] [PATCH] dm: introduce a DM_ENFORCE_OPEN_COUNT flag.

2022-02-02 Thread Christoph Hellwig
Withmy block hat on: nak to this. No block driver has any business at all rejecting "too many openers". In fact any opener but the first of a partition is already not counted as an opener, and I plan to complete hide the open count from the device driver. -- dm-devel mailing list dm-devel@redhat

[dm-devel] [PATCH 01/13] drbd: set ->bi_bdev in drbd_req_new

2022-02-02 Thread Christoph Hellwig
Make sure the newly allocated bio has the correct bi_bdev set from the start. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_req.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index

[dm-devel] improve the bio cloning interface v2

2022-02-02 Thread Christoph Hellwig
Hi Jens, this series changes the bio cloning interface to match the rest changes to the bio allocation interface and passes the block_device and operation to the cloning helpers. In addition it renames the cloning helpers to be more descriptive. To get there it requires a bit of refactoring in t

[dm-devel] [PATCH 04/13] dm: fold __send_duplicate_bios into __clone_and_map_simple_bio

2022-02-02 Thread Christoph Hellwig
Fold __send_duplicate_bios into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 9384d250a3e4e..2527b287ead0f

[dm-devel] [PATCH 02/13] dm: add a clone_to_tio helper

2022-02-02 Thread Christoph Hellwig
Add a helper to stop open coding the container_of operations to get from the clone bio to the tio structure. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md

[dm-devel] [PATCH 03/13] dm: fold clone_bio into __clone_and_map_data_bio

2022-02-02 Thread Christoph Hellwig
Fold clone_bio into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5543e18f3c3bc

[dm-devel] [PATCH 05/13] dm: move cloning the bio into alloc_tio

2022-02-02 Thread Christoph Hellwig
Move the call to __bio_clone_fast and the assignment of ->len_ptr from the callers into alloc_tio to prepare for changes to the bio clone API. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --gi

[dm-devel] [PATCH 08/13] dm: simplify the single bio fast path in __send_duplicate_bios

2022-02-02 Thread Christoph Hellwig
Most targets just need a single flush bio. Open code that case in __send_duplicate_bios without the need to add the bio to a list. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/md

[dm-devel] [PATCH 12/13] block: initialize the target bio in __bio_clone_fast

2022-02-02 Thread Christoph Hellwig
All callers of __bio_clone_fast initialize the bio first. Move that initialization into __bio_clone_fast instead. Signed-off-by: Christoph Hellwig --- block/bio.c | 75 - drivers/md/bcache/request.c | 1 - drivers/md/md-multipath.c | 1

[dm-devel] [PATCH 10/13] block: clone crypto and integrity data in __bio_clone_fast

2022-02-02 Thread Christoph Hellwig
all callers except for the above mentioned one also don't need to handle failure at all, given that the integrity and crypto clones are based on mempool allocations that won't fail for sleeping allocations. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 1 - b

[dm-devel] [PATCH 11/13] dm: use bio_clone_fast in alloc_io/alloc_tio

2022-02-02 Thread Christoph Hellwig
Replace open coded bio_clone_fast implementations with the actual helper. Note that the bio allocated as part of the dm_io structure in alloc_io will only actually be used later in alloc_tio, making this earlier cloning of the information safe. Signed-off-by: Christoph Hellwig --- drivers/md

[dm-devel] [PATCH 09/13] dm-cache: remove __remap_to_origin_clear_discard

2022-02-02 Thread Christoph Hellwig
Fold __remap_to_origin_clear_discard into the two callers to prepare for bio cloning refactoring. Signed-off-by: Christoph Hellwig --- drivers/md/dm-cache-target.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/md/dm-cache-target.c b

[dm-devel] [PATCH 07/13] dm: retun the clone bio from alloc_tio

2022-02-02 Thread Christoph Hellwig
Return the clone bio embedded into the tio as that is what the callers actually want. Similar for the free side. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/md/dm.c b

[dm-devel] [PATCH 13/13] block: pass a block_device to bio_clone_fast

2022-02-02 Thread Christoph Hellwig
Pass a block_device to bio_clone_fast and __bio_clone_fast and give the functions more suitable names. Signed-off-by: Christoph Hellwig --- Documentation/block/biodoc.rst | 5 - block/bio.c | 31 + block/blk-mq.c | 4

[dm-devel] [PATCH 06/13] dm: pass the bio instead of tio to __map_bio

2022-02-02 Thread Christoph Hellwig
This simplifies the callers a bit. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 90341b7fa5809..a43d280e9bc54 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c

Re: [PATCH v5 1/7] mce: fix set_mce_nospec to always unmap the whole page

2022-02-03 Thread Christoph Hellwig
On Wed, Feb 02, 2022 at 11:07:37PM +, Jane Chu wrote: > On 2/2/2022 1:20 PM, Jane Chu wrote: > >> Wouldn't it make more sense to move these helpers out of line rather > >> than exporting _set_memory_present? > > > > Do you mean to move > > return change_page_attr_set(&addr, numpages, __pgp

Re: [PATCH v5 2/7] dax: introduce dax device flag DAXDEV_RECOVERY

2022-02-03 Thread Christoph Hellwig
On Wed, Feb 02, 2022 at 09:27:42PM +, Jane Chu wrote: > Yeah, I see. Would you suggest a way to pass the indication from > dax_iomap_iter to dax_direct_access that the caller intends the > callee to ignore poison in the range because the caller intends > to do recovery_write? We tried adding a

Re: [dm-devel] [RFC PATCH 3/3] nvme: add the "debug" host driver

2022-02-03 Thread Christoph Hellwig
On Thu, Feb 03, 2022 at 08:06:33AM -0800, Luis Chamberlain wrote: > On Wed, Feb 02, 2022 at 06:01:13AM +, Adam Manzanares wrote: > > BTW I think having the target code be able to implement simple copy without > > moving data over the fabric would be a great way of showing off the command. > >

Re: [dm-devel] [RFC PATCH 3/3] nvme: add the "debug" host driver

2022-02-04 Thread Christoph Hellwig
On Fri, Feb 04, 2022 at 03:15:02PM +0100, Hannes Reinecke wrote: >> ZNS kernel code testing is also done on QEMU, I've also fixed >> bugs in the ZNS kernel code which are discovered on QEMU and I've not >> seen any issues with that. Given that simple copy feature is way smaller >> than ZNS it will

[dm-devel] [PATCH 2/7] drbd: drop REQ_OP_WRITE_SAME support

2022-02-09 Thread Christoph Hellwig
REQ_OP_WRITE_SAME was only ever submitted by the legacy Linux zeroing code, which has switched to use REQ_OP_WRITE_ZEROES long ago. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 31 ++--- drivers/block/drbd/drbd_nl.c | 72

[dm-devel] [PATCH 7/7] block: remove REQ_OP_WRITE_SAME support

2022-02-09 Thread Christoph Hellwig
No more users of REQ_OP_WRITE_SAME or drivers implementing it are left, so remove the infrastructure. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 13 +- block/blk-lib.c | 91 --- block/blk-merge.c | 40

[dm-devel] [PATCH 5/7] md: drop WRITE_SAME support

2022-02-09 Thread Christoph Hellwig
There are no more end-users of REQ_OP_WRITE_SAME left, so we can start deleting it. Signed-off-by: Christoph Hellwig --- drivers/md/md-linear.c| 1 - drivers/md/md-multipath.c | 1 - drivers/md/md.h | 7 --- drivers/md/raid0.c| 2 -- drivers/md/raid1.c| 4

[dm-devel] [PATCH 4/7] sd: remove write same support

2022-02-09 Thread Christoph Hellwig
There are no more end-users of REQ_OP_WRITE_SAME left, so we can start deleting it. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 75 --- drivers/scsi/sd_zbc.c | 2 -- 2 files changed, 7 insertions(+), 70 deletions(-) diff --git a/drivers

[dm-devel] [PATCH 1/7] cxlflash: query write_zeroes limit for zeroing

2022-02-09 Thread Christoph Hellwig
The write_same and write_zeroes limits for SCSI are effectively the same, so the current code works just fine. But we plan to remove REQ_OP_WRITE_SAME support, so switch to quering the write zeroes limit for a zeroing WRITE SAME operation. Signed-off-by: Christoph Hellwig --- drivers/scsi

[dm-devel] remove REQ_OP_WRITE_SAME v2

2022-02-09 Thread Christoph Hellwig
Now that we are using REQ_OP_WRITE_ZEROES for all zeroing needs in the kernel there is very little use left for REQ_OP_WRITE_SAME. We only have two callers left, and both just export optional protocol features to remote systems: DRBD and the target code. For the target code the only real use case

[dm-devel] [PATCH 6/7] dm: remove write same support

2022-02-09 Thread Christoph Hellwig
There are no more end-users of REQ_OP_WRITE_SAME left, so we can start deleting it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-core.h | 1 - drivers/md/dm-crypt.c | 1 - drivers/md/dm-ebs-target.c| 1 - drivers/md/dm-io.c| 22

[dm-devel] [PATCH 3/7] rnbd: drop WRITE_SAME support

2022-02-09 Thread Christoph Hellwig
REQ_OP_WRITE_SAME was only ever submitted by the legacy Linux zeroing code, which has switched to use REQ_OP_WRITE_ZEROES long before rnbd was even merged. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-clt.c | 7 ++- drivers/block/rnbd/rnbd-clt.h | 1 - drivers/block/rnbd

Re: [dm-devel] [PATCH 3/7] rnbd: drop WRITE_SAME support

2022-02-09 Thread Christoph Hellwig
On Wed, Feb 09, 2022 at 11:16:13AM +0100, Jinpu Wang wrote: > Hi Christoph, > > > On Wed, Feb 9, 2022 at 9:28 AM Christoph Hellwig wrote: > > > > REQ_OP_WRITE_SAME was only ever submitted by the legacy Linux zeroing > > code, which has switched to use REQ_OP_WRI

Re: [dm-devel] [PATCH] dm io: Drop the obsolete and incorrect doc for dm_io()

2022-02-09 Thread Christoph Hellwig
c_io_complete() as the notify.fn and explicitly > calls wait_for_completion_io() to sync. The comment isn't valid > any more. Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] remove REQ_OP_WRITE_SAME v2

2022-02-09 Thread Christoph Hellwig
On Wed, Feb 09, 2022 at 01:00:26PM -0500, Martin K. Petersen wrote: > > Christoph, > > > Now that we are using REQ_OP_WRITE_ZEROES for all zeroing needs in the > > kernel there is very little use left for REQ_OP_WRITE_SAME. We only > > have two callers left, and both just export optional protoco

Re: [dm-devel] [PATCH 03/14] dm: refactor dm_split_and_process_bio a bit

2022-02-10 Thread Christoph Hellwig
GFP_NOIO, &md->queue->bio_split); bio_chain(ci.io->orig_bio, bio); trace_block_split(ci.io->orig_bio, bio->bi_iter.bi_sector); submit_bio_noacct(bio); and remove another layer of indentation uing the existing label? Otherwise looks good: Revi

Re: [dm-devel] [PATCH 06/14] dm: remove unused mapped_device argument from free_tio

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:24PM -0500, Mike Snitzer wrote: > Signed-off-by: Mike Snitzer Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 07/14] dm: remove code only needed before submit_bio recursion

2022-02-10 Thread Christoph Hellwig
t; len = min_t(sector_t, max_io_len(ti, ci->sector), ci->sector_count); > > clone = alloc_tio(ci, ti, 0, &len, GFP_NOIO); > - bio_advance(clone, to_bytes(ci->sector - clone->bi_iter.bi_sector)); > clone->bi_iter.bi_size = to_bytes(len); Maybe move the

Re: [dm-devel] [PATCH 02/14] dm: fold __clone_and_map_data_bio into __split_and_process_bio

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:20PM -0500, Mike Snitzer wrote: > Fold __clone_and_map_data_bio into its only caller. Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 04/14] dm: reduce code duplication in __map_bio

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:22PM -0500, Mike Snitzer wrote: > Error path code (for handling DM_MAPIO_REQUEUE and DM_MAPIO_KILL) is > effectively identical. Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listi

Re: [dm-devel] [PATCH 08/14] dm: record old_sector in dm_target_io before calling map function

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:26PM -0500, Mike Snitzer wrote: > Prep for being able to defer trace_block_bio_remap() until when the > bio is remapped and submitted by the DM target. Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 05/14] dm: remove impossible BUG_ON in __send_empty_flush

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:23PM -0500, Mike Snitzer wrote: > The flush_bio in question was just initialized to be empty, so there > is no way bio_has_data() will retrun true. So remove stale BUG_ON(). s/retrun/return/ Otherwise looks good: Reviewed-by: Christoph Hellwig -- dm

Re: [dm-devel] [PATCH 01/14] dm: rename split functions

2022-02-10 Thread Christoph Hellwig
good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 09/14] dm: prep for following changes

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:27PM -0500, Mike Snitzer wrote: > Rename dm_io struct's 'endio_lock' member to 'lock' to reuse spinlock > to protect new member used to flag if IO accounting has been started. > > Also move kicking of the suspend queue out to dm_io_dec_pending (the > only caller) sinc

Re: [dm-devel] [PATCH 14/14] block: add bio_start_io_acct_remapped for the benefit of DM

2022-02-10 Thread Christoph Hellwig
On Thu, Feb 10, 2022 at 05:38:32PM -0500, Mike Snitzer wrote: > DM needs the ability to account a clone bio's IO to the original > block_device. So add @orig_bdev argument to bio_start_io_acct_time. > Rename bio_start_io_acct_time to bio_start_io_acct_remapped. > Also, follow bio_end_io_acct and bi

Re: [dm-devel] [PATCH v2 14/14] dm: move duplicate code in callers of alloc_tio into alloc_tio

2022-02-14 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v2 10/14] block: add bio_start_io_acct_remapped for the benefit of DM

2022-02-14 Thread Christoph Hellwig
follow bio_end_io_acct and bio_end_io_acct_remapped pattern by > moving bio_start_io_acct to blkdev.h and have it call > bio_start_io_acct_remapped. Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 5/5] dm: remove dm_dispatch_clone_request

2022-02-15 Thread Christoph Hellwig
Fold dm_dispatch_clone_request into it's only caller, and use a switch statement to single dispatch for the handling of the different return values from blk_insert_cloned_request. Signed-off-by: Christoph Hellwig --- drivers/md/dm-rq.c | 22 +- 1 file changed, 9 inser

[dm-devel] make the blk-mq stacking interface optional

2022-02-15 Thread Christoph Hellwig
Hi Jens, this series requires an explicit select to use the blk-mq stacking interfaces. This means they don't get build without dm support, and thus the buildbot should catch abuses like the one we had in the ufs driver more easily. And while I touched this code I also ended up cleaning up vario

[dm-devel] [PATCH 1/5] blk-mq: make the blk-mq stacking code optional

2022-02-15 Thread Christoph Hellwig
effects is that kernel builds without device mapper shrink a little bit as well. Signed-off-by: Christoph Hellwig --- block/Kconfig | 3 +++ block/blk-mq.c | 2 ++ drivers/md/Kconfig | 1 + 3 files changed, 6 insertions(+) diff --git a/block/Kconfig b/block/Kconfig index 205f8d01c6952

[dm-devel] [PATCH 4/5] dm: remove useless code from dm_dispatch_clone_request

2022-02-15 Thread Christoph Hellwig
Both ->start_time_ns and the RQF_IO_STAT are set when the request is allocated using blk_mq_alloc_request by dm-mpath in blk_mq_rq_ctx_init. The block layer also ensures ->start_time_ns is only set when actually needed. Signed-off-by: Christoph Hellwig --- drivers/md/dm-rq.c | 4

[dm-devel] [PATCH 3/5] blk-mq: remove the request_queue argument to blk_insert_cloned_request

2022-02-15 Thread Christoph Hellwig
The request must be submitted to the queue it was allocated for, so remove the extra request_queue argument. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 9 - drivers/md/dm-rq.c | 2 +- include/linux/blk-mq.h | 3 +-- 3 files changed, 6 insertions(+), 8 deletions

[dm-devel] [PATCH 2/5] blk-mq: fold blk_cloned_rq_check_limits into blk_insert_cloned_request

2022-02-15 Thread Christoph Hellwig
Fold blk_cloned_rq_check_limits into its only caller. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 38 +- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index db62d34afb637..fc132933397fb 100644 --- a

Re: [dm-devel] remove REQ_OP_WRITE_SAME v2

2022-02-16 Thread Christoph Hellwig
On Wed, Feb 16, 2022 at 08:07:56PM -0700, Jens Axboe wrote: > Let's just use the SCSI tree - I didn't check if it throws any conflicts > right now, so probably something to check upfront... There is a minor conflict because the __blkdev_issue_write_same function removed by this series is affected

Re: [dm-devel] [PATCH 7/7] block: remove REQ_OP_WRITE_SAME support

2022-02-21 Thread Christoph Hellwig
ng)q->limits.max_write_same_sectors << 9); > > -} > > - > > This tripped one of my test scripts. We should probably return 0 here > like we did for discard_zeroes_data and leave the sysfs entry in place. The maybe fold this in? --- >From eae8e9b8cff5ee8522b00430a4aabd01ebc7c55a Mon Sep

[dm-devel] [PATCH 3/5] target/pscsi: remove pscsi_get_bio

2022-03-01 Thread Christoph Hellwig
Remove pscsi_get_bio and simplify the code flow in the only caller. Signed-off-by: Christoph Hellwig --- drivers/target/target_core_pscsi.c | 28 ++-- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target

[dm-devel] [PATCH 1/5] btrfs: simplify ->flush_bio handling

2022-03-01 Thread Christoph Hellwig
Use and embedded bios that is initialized when used instead of bio_kmalloc plus bio_reset. Signed-off-by: Christoph Hellwig --- fs/btrfs/disk-io.c | 8 +--- fs/btrfs/volumes.c | 11 --- fs/btrfs/volumes.h | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/fs

[dm-devel] [PATCH 5/5] pktcdvd: stop using bio_reset

2022-03-01 Thread Christoph Hellwig
Just initialize the bios on-demand. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 6aec11ed185d8..e4ee7856483cf 100644 --- a

[dm-devel] cleanup bio_kmalloc

2022-03-01 Thread Christoph Hellwig
Hi Jens, this series finishes off the bio allocation interface cleanups by dealing with the weirdest member of the famility. bio_kmalloc combines a kmalloc for the bio and bio_vecs with a hidden bio_init call and magic cleanup semantics. This series moves a few callers away from bio_kmalloc and

[dm-devel] [PATCH 4/5] block: turn bio_kmalloc into a simple kmalloc wrapper

2022-03-01 Thread Christoph Hellwig
Remove the magic autofree semantics and require the callers to explicitly call bio_init to initialize the bio. This allows bio_free to catch accidental bio_put calls on bio_init()ed bios as well. Signed-off-by: Christoph Hellwig --- block/bio.c| 47

[dm-devel] [PATCH 2/5] squashfs: always use bio_kmalloc in squashfs_bio_read

2022-03-01 Thread Christoph Hellwig
If a plain kmalloc that is not backed by a mempool is safe here for a large read (and the actual page allocations), it must also be for a small one, so simplify the code a bit. Signed-off-by: Christoph Hellwig --- fs/squashfs/block.c | 11 +++ 1 file changed, 3 insertions(+), 8

[dm-devel] [PATCH 2/2] dm: stop using bdevname

2022-03-01 Thread Christoph Hellwig
Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig --- drivers/md/dm-cache-target.c | 10 -- drivers/md/dm-clone-target.c | 10 -- drivers/md/dm-mpath.c| 6 ++ drivers/md/dm-table.c| 30 ++ drivers/md/dm

[dm-devel] [PATCH 1/2] dm-zoned: remove the ->name field in struct dmz_dev

2022-03-01 Thread Christoph Hellwig
Just use the %pg format specifier to print the block device name directly. Signed-off-by: Christoph Hellwig --- drivers/md/dm-zoned-metadata.c | 4 ++-- drivers/md/dm-zoned-target.c | 1 - drivers/md/dm-zoned.h | 9 - 3 files changed, 6 insertions(+), 8 deletions(-) diff

[dm-devel] [PATCH 04/10] dm-crypt: stop using bio_devname

2022-03-04 Thread Christoph Hellwig
Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig --- drivers/md/dm-crypt.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index a5006cb6ee8ad..e2b0af4a2ee84

[dm-devel] [PATCH 09/10] ext4: stop using bio_devname

2022-03-04 Thread Christoph Hellwig
Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig --- fs/ext4/page-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 1253982268730..18373fa529225 100644 --- a/fs/ext4

[dm-devel] [PATCH 03/10] pktcdvd: remove a pointless debug check in pkt_submit_bio

2022-03-04 Thread Christoph Hellwig
->queuedata is set up in pkt_init_queue, so it can't be NULL here. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 623df4141ff3f..a52bbedd2f33

[dm-devel] [PATCH 01/10] block: fix and cleanup bio_check_ro

2022-03-04 Thread Christoph Hellwig
Don't use a WARN_ON when printing a potentially user triggered condition. Also don't print the partno when the block device name already includes it, and use the %pg specifier to simplify printing the block device name. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 8 ++

[dm-devel] [PATCH 10/10] block: remove bio_devname

2022-03-04 Thread Christoph Hellwig
All callers are gone, so remove this wrapper. Signed-off-by: Christoph Hellwig --- block/bio.c | 6 -- include/linux/bio.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/block/bio.c b/block/bio.c index b15f5466ce084..151cace2dbe16 100644 --- a/block/bio.c +++ b/block/bio.c

[dm-devel] remove bio_devname

2022-03-04 Thread Christoph Hellwig
Hi Jens, this series removes the bio_devname helper and just switches all users to use the %pg format string directly. Diffstat block/bio.c |6 -- block/blk-core.c | 25 +++-- drivers/block/pktcdvd.c |9 + drivers/md/dm-crypt.c

[dm-devel] [PATCH 02/10] block: remove handle_bad_sector

2022-03-04 Thread Christoph Hellwig
Use the %pg format specifier instead of the stack hungry bdevname function, and remove handle_bad_sector given that it is not pointless. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/block/blk-core.c

<    12   13   14   15   16   17   18   19   20   21   >