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

2022-01-24 Thread Jinpu Wang
On Mon, Jan 24, 2022 at 10:11 AM Christoph Hellwig wrote: > > 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 Reviewed-by: Jack Wang Thanks! > --- > drivers/bloc

Re: [dm-devel] [PATCH] dm: introduce a no open flag for deferred remove

2022-01-24 Thread Alasdair G Kergon
On Mon, Jan 24, 2022 at 10:25:47AM -0500, Brian Geffon wrote: > Thank you for looking at this. There are a few reasons this might be > useful, the first is if you're trying to speed up a graceful teardown > of the device by informing userspace that this device is going to be > removed in the near f

Re: [dm-devel] [PATCH] dm: introduce a no open flag for deferred remove

2022-01-24 Thread Alasdair G Kergon
On Mon, Jan 24, 2022 at 07:02:09AM -0800, Brian Geffon wrote: > When a device is being removed with deferred remove it's > still possible to open and use the device. This change > introduces a flag called DM_DEFERRED_REMOVE_NO_OPEN_FLAG > which when used with DM_DEFERRED_REMOVE will cause any > new

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

2022-01-24 Thread Christoph Hellwig
Pass the block_device and operation that we plan to use this bio for to bio_alloc to optimize the assignment. NULL/0 can be passed, both for the passthrough case on a raw request_queue and to temporarily avoid refactoring some nasty code. Also move the gfp_mask argument after the nr_vecs argument

[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 Reviewed

[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 Reviewed

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

2022-01-24 Thread Christoph Hellwig
Pass the block_device and operation that we plan to use this bio for to bio_alloc_bioset to optimize the assigment. NULL/0 can be passed, both for the passthrough case on a raw request_queue and to temporarily avoid refactoring some nasty code. Also move the gfp_mask argument after the nr_vecs ar

[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 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-blkback/

[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/block/rnb

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

2022-01-24 Thread Christoph Hellwig
From: Chaitanya Kulkarni All callers need to set the block_device and operation, so lift that into the common code. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- block/bio.c | 6 +- block/blk-lib.c | 19 +-- block/blk-zoned

[dm-devel] [PATCH 03/19] nfs/blocklayout: remove bl_alloc_init_bio

2022-01-24 Thread Christoph Hellwig
bio_alloc will never fail when it can sleep. Remove the now simple bl_alloc_init_bio helper and open code it in the only caller. Signed-off-by: Christoph Hellwig --- fs/nfs/blocklayout/blocklayout.c | 26 +- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/

[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/nilf

[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 43

[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 07/19] dm-snap: use blkdev_issue_flush instead of open coding it

2022-01-24 Thread Christoph Hellwig
Use blkdev_issue_flush, which uses an on-stack bio instead of an opencoded version with a bio embedded into struct dm_snapshot. Signed-off-by: Christoph Hellwig --- drivers/md/dm-snap.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/md/dm-snap.c

[dm-devel] [PATCH 10/19] rnbd-srv: simplify bio mapping in process_rdma

2022-01-24 Thread Christoph Hellwig
The memory mapped in process_rdma is contiguous, so there is no need to loop over bio_add_page. Remove rnbd_bio_map_kern and just open code the bio allocation and mapping in the caller. Signed-off-by: Christoph Hellwig Reviewed-by: Jack Wang Tested-by: Jack Wang --- drivers/block/rnbd/rnbd-sr

[dm-devel] [PATCH 08/19] dm-thin: use blkdev_issue_flush instead of open coding it

2022-01-24 Thread Christoph Hellwig
Use blkdev_issue_flush, which uses an on-stack bio instead of an opencoded version with a bio embedded into struct pool. Signed-off-by: Christoph Hellwig --- drivers/md/dm-thin.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-

[dm-devel] [PATCH 04/19] ntfs3: remove ntfs_alloc_bio

2022-01-24 Thread Christoph Hellwig
bio_alloc will never fail if it is allowed to sleep, so there is no need for this loop. Also remove the __GFP_HIGH specifier as it doesn't make sense here given that we'll always fall back to the mempool anyway. Signed-off-by: Christoph Hellwig --- fs/ntfs3/fsntfs.c | 23 ++-

[dm-devel] [PATCH 09/19] drbd: 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/drbd/drbd_receiver.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/dri

[dm-devel] [PATCH 05/19] dm: bio_alloc can't fail if it is allowed 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/md/dm-crypt.c | 5 + drivers/md/dm-log-writes.c | 18 -- drivers/md/dm-thin.c | 25 + driver

[dm-devel] improve the bio allocation interface v2

2022-01-24 Thread Christoph Hellwig
Hi Jens, this series is posted early because it has wide-ranging changes and could use some early ACKs before -rc1. It changes the interface to the bio allocators to always pass a block_device and the operation, which is information needed for every bio submitted through bio_submit. This means

[dm-devel] [PATCH 01/19] fs: remove mpage_alloc

2022-01-24 Thread Christoph Hellwig
open code mpage_alloc in it's two callers and simplify the results because of the context: - __mpage_writepage always passes GFP_NOFS and can thus always sleep and will never get a NULL return from bio_alloc at all. - do_mpage_readpage can only get a non-sleeping context for readahead whi

Re: [PATCH v3 0/7] DAX poison recovery

2022-01-24 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 01:33:40AM +, Jane Chu wrote: > > What tree is this against? I can't apply it to either 5.16 or Linus' > > current tree. > > It was based on your 'dax-block-cleanup' branch a while back. Do you have a git tree with your patches included available somewhere?