Re: [PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:54:30PM -0800, Darrick J. Wong wrote: > Nit: no space before the paren ^ here. Fixed.

Re: [PATCH 21/29] xfs: move dax device handling into xfs_{alloc,free}_buftarg

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:40:47PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Hide the DAX device lookup from the xfs_super.c code. > > > > Reviewed-by: Christoph Hellwig > > That's an interesting spelli

Re: [PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:56:29PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Prepare from removing the block_device from the DAX I/O path by returning > > s/from removing/for the removal of/ Fixed. > >

Re: [PATCH 22/29] iomap: add a IOMAP_DAX flag

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:47:10PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Add a flag so that the file system can easily detect DAX operations. > > Looks ok, but I would have preferred a quick note about the rationale >

Re: [PATCH 23/29] xfs: use IOMAP_DAX to check for DAX mappings

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 03:01:24PM -0800, Darrick J. Wong wrote: > On Tue, Nov 09, 2021 at 09:33:03AM +0100, Christoph Hellwig wrote: > > Use the explicit DAX flag instead of checking the inode flag in the > > iomap code. > > > > Signed-off-by: Christoph Hellwig &g

decouple DAX from block devices v2

2021-11-29 Thread Christoph Hellwig
Hi Dan, this series decouples the DAX from the block layer so that the block_device is not needed at all for the DAX I/O path. Changes since v1: - rebase on latest v5.16-rc - ensure the new dax zeroing helpers are always declared - fix a dax_dev leak in pmem_attach_disk - remove '\n' from an

[PATCH 05/29] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-11-29 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff

[PATCH 08/29] dax: remove dax_capable

2021-11-29 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Gao Xiang [erofs] Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 36

[PATCH 01/29] dm: fix alloc_dax error handling in alloc_dev

2021-11-29 Thread Christoph Hellwig
Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR. Reported-by: Dan Williams Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm

[PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-29 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/bus.c| 6

[PATCH 09/29] dm-linear: add a linear_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by

[PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 23 ++-

[PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-29 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3

[PATCH 02/29] dm: make the DAX support depend on CONFIG_FS_DAX

2021-11-29 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig Ack

[PATCH 12/29] fsdax: remove a pointless __force cast in copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Despite its name copy_user_page expected kernel addresses, which is what we already have. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index

[PATCH 10/29] dm-log-writes: add a log_writes_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by

[PATCH 07/29] xfs: factor out a xfs_setup_dax_always helper

2021-11-29 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 47

[PATCH 11/29] dm-stripe: add a stripe_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by

[PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-29 Thread Christoph Hellwig
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 14 -- fs/dax.c

[PATCH 13/29] fsdax: use a saner calling convention for copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 29 + 1 file

[PATCH 15/29] xfs: add xfs_zero_range and xfs_truncate_page helpers

2021-11-29 Thread Christoph Hellwig
From: Shiyang Ruan Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bmap_util.c | 7 +++ fs

[PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-29 Thread Christoph Hellwig
Factor out a helper for the "manual" zeroing of a DAX range to clean up dax_iomap_zero a lot. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletion

[PATCH 16/29] fsdax: simplify the offset check in dax_iomap_zero

2021-11-29 Thread Christoph Hellwig
The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-29 Thread Christoph Hellwig
for reflink support as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/dax.c | 77 ++ fs/ext2/inode.c| 7 ++-- fs/ext4/inode.c| 5 +-- fs/iomap/buffered-io.c | 35 +++ fs/xfs/xfs_iomap.c

[PATCH 19/29] ext2: cleanup the dax handling in ext2_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext2/super.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff

[PATCH 21/29] xfs: move dax device handling into xfs_{alloc,free}_buftarg

2021-11-29 Thread Christoph Hellwig
Hide the DAX device lookup from the xfs_super.c code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Dan Williams --- fs/xfs/xfs_buf.c | 8 fs/xfs/xfs_buf.h | 4 ++-- fs/xfs/xfs_super.c | 26 +- 3 files changed, 11 insertions

[PATCH 22/29] xfs: use xfs_direct_write_iomap_ops for DAX zeroing

2021-11-29 Thread Christoph Hellwig
While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_iomap.c | 4 ++-- 1 file

[PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext4/super.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 23/29] xfs: pass the mapping flags to xfs_bmbt_to_iomap

2021-11-29 Thread Christoph Hellwig
To prepare for looking at the IOMAP_DAX flag in xfs_bmbt_to_iomap pass in the input mapping flags to xfs_bmbt_to_iomap. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_bmap.c | 4 ++-- fs/xfs/xfs_aops.c| 2 +- fs/xfs/xfs_iomap.c | 35

[PATCH 24/29] iomap: add a IOMAP_DAX flag

2021-11-29 Thread Christoph Hellwig
are based on the block device. In the long run it should also allow turning the bdev, dax_dev and inline_data into a union. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/dax.c | 7 --- fs/ext4/inode.c | 4 ++-- fs/xfs/xfs_iomap.c| 7 --- fs/xfs

[PATCH 26/29] fsdax: shift partition offset handling into the file systems

2021-11-29 Thread Christoph Hellwig
Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig Reviewed-by: Gao X

[PATCH 27/29] dax: fix up some of the block device related ifdefs

2021-11-29 Thread Christoph Hellwig
The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- include

[PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
Prepare for the removal of the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 9 ++--- drivers/md

[PATCH 28/29] iomap: build the block based code conditionally

2021-11-29 Thread Christoph Hellwig
Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig| 4 ++-- fs/iomap/Makefile | 4 ++-- 2 files changed, 4

[PATCH 29/29] fsdax: don't require CONFIG_BLOCK

2021-11-29 Thread Christoph Hellwig
The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [dm-devel] [RFC][PATCH] device mapper: Add builtin function dm_get_status()

2021-12-02 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 07:59:38AM +, Roberto Sassu wrote: > ok, I will send it together with a patch for a not yet accepted > software, Integrity Policy Enforcement (IPE), that will be > the primary user of the introduced functionality. > > Regarding the patch itself, could you please provide

Re: [dm-devel] [RFC][PATCH] device mapper: Add builtin function dm_get_status()

2021-12-02 Thread Christoph Hellwig
On Wed, Dec 01, 2021 at 05:37:08PM +0100, Roberto Sassu wrote: > Users of the device mapper driver might want to obtain a device status, > with status types defined in the status_type_t enumerator. The patch looks really odd. And without the corresponding user of your new functionality it is enti

Re: [dm-devel] [RFC][PATCH] device mapper: Add builtin function dm_get_status()

2021-12-03 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 09:29:52AM +, Roberto Sassu wrote: > The problem being solved is how to grant access to files > which satisfy a property defined in the policy. If you have want to enforce access to files in the block layer using a specific stacking block driver you don't just have one

[PATCH 5/5] dax: always use _copy_mc_to_iter in dax_copy_to_iter

2021-12-08 Thread Christoph Hellwig
While using the MC-safe copy routines is rather pointless on a virtual device like virtiofs, it also isn't harmful at all. So just use _copy_mc_to_iter unconditionally to simplify the code. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 10 -- fs/fuse/virtio_fs.c

[PATCH 2/5] dax: simplify dax_synchronous and set_dax_synchronous

2021-12-08 Thread Christoph Hellwig
Remove the pointless wrappers. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 8 include/linux/dax.h | 12 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index e7152a6c4cc40..e18155f43a635 100644 --- a

devirtualize kernel access to DAX

2021-12-08 Thread Christoph Hellwig
Hi Dan, this series cleans up a few loose end ends and then removes the copy_from_iter and copy_to_iter dax_operations methods in favor of straight calls. Diffstat: drivers/dax/bus.c |3 + drivers/dax/super.c | 40 ++--- drivers/md/dm-linear.c|

[PATCH 3/5] dax: remove the DAXDEV_F_SYNC flag

2021-12-08 Thread Christoph Hellwig
Remove the DAXDEV_F_SYNC flag and thus the flags argument to alloc_dax and just let the drivers call set_dax_synchronous directly. Signed-off-by: Christoph Hellwig --- drivers/dax/bus.c| 3 ++- drivers/dax/super.c | 6 +- drivers/md/dm.c | 2 +- drivers

[PATCH 1/5] uio: remove copy_from_iter_flushcache() and copy_mc_to_iter()

2021-12-08 Thread Christoph Hellwig
These two wrappers are never used. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c | 4 ++-- include/linux/uio.h | 20 +--- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 4190c8c46ca88

[PATCH 4/5] dax: remove the copy_from_iter and copy_to_iter methods

2021-12-08 Thread Christoph Hellwig
, then use them everywhere as they fall back to the plain ones on s390 anyway and remove an indirect call from the read/write path as well as a lot of boilerplate code. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 36 ++-- drivers/md/dm-linear.c| 20

Re: [PATCH 5/5] dax: always use _copy_mc_to_iter in dax_copy_to_iter

2021-12-13 Thread Christoph Hellwig
On Sun, Dec 12, 2021 at 06:48:05AM -0800, Dan Williams wrote: > On Fri, Dec 10, 2021 at 6:05 AM Vivek Goyal wrote: > > > > On Thu, Dec 09, 2021 at 07:38:28AM +0100, Christoph Hellwig wrote: > > > While using the MC-safe copy routines is rather pointless on a virtual

Re: [PATCH 4/5] dax: remove the copy_from_iter and copy_to_iter methods

2021-12-13 Thread Christoph Hellwig
On Sun, Dec 12, 2021 at 06:44:26AM -0800, Dan Williams wrote: > On Fri, Dec 10, 2021 at 6:17 AM Vivek Goyal wrote: > > Going forward, I am wondering should virtiofs use flushcache version as > > well. What if host filesystem is using DAX and mapping persistent memory > > pfn directly into qemu add

Re: [PATCH 4/5] dax: remove the copy_from_iter and copy_to_iter methods

2021-12-13 Thread Christoph Hellwig
On Sun, Dec 12, 2021 at 06:39:16AM -0800, Dan Williams wrote: > > /* flag to check if device supports synchronous flush */ > > DAXDEV_SYNC, > > + /* do not use uncached operations to write data */ > > + DAXDEV_CACHED, > > + /* do not use mcsafe operations to read d

Re: [PATCH 1/5] uio: remove copy_from_iter_flushcache() and copy_mc_to_iter()

2021-12-13 Thread Christoph Hellwig
On Sun, Dec 12, 2021 at 06:22:20AM -0800, Dan Williams wrote: > > - * Use the 'no check' versions of copy_from_iter_flushcache() and > > - * copy_mc_to_iter() to bypass HARDENED_USERCOPY overhead. Bounds > > + * Use the 'no check' versions of _copy_from_iter_flushcache() and > > + * _copy_mc_to_ite

devirtualize kernel access to DAX v2

2021-12-15 Thread Christoph Hellwig
Hi Dan, this series cleans up a few loose end ends and then removes the copy_from_iter and copy_to_iter dax_operations methods in favor of straight calls. Changes since v1: - reword a 'no check' comment - clean up the flags for the copy routine variants - drop the last patch Diffstat: driver

[PATCH 1/4] uio: remove copy_from_iter_flushcache() and copy_mc_to_iter()

2021-12-15 Thread Christoph Hellwig
These two wrappers are never used. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c | 4 +--- include/linux/uio.h | 20 +--- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 4190c8c46ca88

[PATCH 3/4] dax: remove the DAXDEV_F_SYNC flag

2021-12-15 Thread Christoph Hellwig
Remove the DAXDEV_F_SYNC flag and thus the flags argument to alloc_dax and just let the drivers call set_dax_synchronous directly. Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Gupta Reviewed-by: Dan Williams --- drivers/dax/bus.c| 3 ++- drivers/dax/super.c | 6

[PATCH 2/4] dax: simplify dax_synchronous and set_dax_synchronous

2021-12-15 Thread Christoph Hellwig
Remove the pointless wrappers. Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Gupta Reviewed-by: Dan Williams --- drivers/dax/super.c | 8 include/linux/dax.h | 12 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax

[PATCH 4/4] dax: remove the copy_from_iter and copy_to_iter methods

2021-12-15 Thread Christoph Hellwig
remove indirect call from the read/write fast path as well as a lot of boilerplate code. Signed-off-by: Christoph Hellwig Reviewed-by: Vivek Goyal [virtiofs] --- drivers/dax/bus.c | 2 + drivers/dax/super.c | 36 ++-- drivers/md/dm-linear.c| 20

Re: [dm-devel] [PATCH 0/3] blk-mq/dm-rq: support BLK_MQ_F_BLOCKING for dm-rq

2021-12-21 Thread Christoph Hellwig
On Tue, Dec 21, 2021 at 10:14:56PM +0800, Ming Lei wrote: > Hello, > > dm-rq may be built on blk-mq device which marks BLK_MQ_F_BLOCKING, so > dm_mq_queue_rq() may become to sleep current context. > > Fixes the issue by allowing dm-rq to set BLK_MQ_F_BLOCKING in case that > any underlying queue i

Re: [dm-devel] [PATCH 1/2] block: add resubmit_bio_noacct()

2022-01-10 Thread Christoph Hellwig
On Mon, Jan 10, 2022 at 03:51:40PM +0800, Ming Lei wrote: > Add block layer API of resubmit_bio_noacct() for handling blk-throttle > iops limit correctly. Typical use case is that bio split, and it isn't > good to export blk_throtl_charge_bio_split() for drivers, so add new API > for serving such p

Re: [dm-devel] [PATCH 1/2] block: add resubmit_bio_noacct()

2022-01-11 Thread Christoph Hellwig
On Mon, Jan 10, 2022 at 02:03:16PM -0500, Mike Snitzer wrote: > Ming is lifting code out of __blk_queue_split() for reuse (by DM in > this instance, because it has its own bio_split+bio_chain). > > Are you saying submit_bio_noacct() should be made to call > blk_throtl_charge_bio_split() and blk_th

Re: [dm-devel] [PATCH 1/2] block: add resubmit_bio_noacct()

2022-01-11 Thread Christoph Hellwig
On Tue, Jan 11, 2022 at 09:56:36AM +0800, Ming Lei wrote: > 2) block throttle is block layer internal stuff, and we shouldn't expose > blk_throtl_charge_bio_split() to driver. > > Maybe rename the new API as submit_split_bio_noacct(), but we can't > reuse submit_bio_noacct() simply, otherwise blk_

Re: [dm-devel] [PATCH 0/3] blk-mq/dm-rq: support BLK_MQ_F_BLOCKING for dm-rq

2022-01-11 Thread Christoph Hellwig
On Tue, Dec 28, 2021 at 04:30:08PM -0500, Mike Snitzer wrote: > Yeah, people use request-based for IO scheduling and more capable path > selectors. Imposing bio-based would be a pretty jarring workaround for > BLK_MQ_F_BLOCKING. request-based DM should properly support it. Given that nvme-tcp is

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

2022-01-16 Thread Christoph Hellwig
On Fri, Jan 14, 2022 at 09:51:20PM +0100, Milan Broz wrote: > I think dm-crypt should stay as SW crypto only (using kernel crypto API, > so HW acceleration is done through crypto drivers there). > > A cleaner solution is to write a much simpler new dm-crypt-inline target, > which will implement on

Re: [dm-devel] [PATCH] dm rq: clear cloned bio ->bi_bdev to fix I/O accounting

2022-01-16 Thread Christoph Hellwig
rom: Christoph Hellwig Date: Thu, 13 Jan 2022 10:53:59 +0100 Subject: block: assign bi_bdev for cloned bios in blk_rq_prep_clone The cloned bios for the cloned request in blk_rq_prep_clone currently still point to the original bi_bdev. This is harmless because dm-mpath doesn't look at bi_bdev but

Re: [dm-devel] [PATCH 0/3] blk-mq/dm-rq: support BLK_MQ_F_BLOCKING for dm-rq

2022-01-17 Thread Christoph Hellwig
On Tue, Jan 11, 2022 at 11:15:09AM -0500, Mike Snitzer wrote: > Round and round we go.. Pretty tired of this. Same here. > You are perfectly fine with incrementally compromising request-based > DM's ability to evolve as block core does. I would not word it that way, but I think we mean the same

Re: [dm-devel] [PATCH 0/3] blk-mq/dm-rq: support BLK_MQ_F_BLOCKING for dm-rq

2022-01-17 Thread Christoph Hellwig
On Tue, Jan 11, 2022 at 01:23:53PM -0500, Jeff Moyer wrote: > Maybe I have bad taste, but the patches didn't look like cruft to me. > :) They do to me. The extend the corner case of request on request stacking that already is a bit of mess even more by adding yet another special case in the block

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

2022-01-17 Thread Christoph Hellwig
ahead which never sets PF_MEMALLOC and thus doesn't need the retry loop either. Both cases will never have __GFP_HIGH set. Signed-off-by: Christoph Hellwig --- fs/mpage.c | 35 ++- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/fs/mpage.c b/

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

2022-01-17 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/fsn

[dm-devel] improve the bio allocation interface

2022-01-17 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 05/19] dm: bio_alloc can't fail if it is allowed to sleep

2022-01-17 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

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

2022-01-17 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 | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver

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

2022-01-17 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 03/19] nfs/blocklayout: remove bl_alloc_init_bio

2022-01-17 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 06/19] dm-crypt: remove clone_init

2022-01-17 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 08/19] dm-thin: use blkdev_issue_flush instead of open coding it

2022-01-17 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 13/19] block: move blk_next_bio to bio.c

2022-01-17 Thread Christoph Hellwig
Keep blk_next_bio next to the core bio infrastructure. Signed-off-by: Christoph Hellwig --- 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 0d400ba2dbd18..43fb28ac6b44e

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

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

2022-01-17 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

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

2022-01-17 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 --- drivers/block/rnbd/rnbd-srv-dev.c | 57

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

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

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

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

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

2022-01-17 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 12/19] xen-blkback: bio_alloc can't fail if it is allow to sleep

2022-01-17 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 16/19] block: pass a block_device and opf to bio_alloc_kiocb

2022-01-17 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 --- block/bio.c | 12 block/fops.c| 17 - include/linux/bio.h | 4 ++-- 3 files changed, 18

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

2022-01-17 Thread Christoph Hellwig
argument for a much more logical calling convention matching what most of the kernel does. Signed-off-by: Christoph Hellwig --- block/bio.c | 29 + block/bounce.c | 6 ++ drivers/block/drbd/drbd_actlog.c| 5

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

2022-01-17 Thread Christoph Hellwig
Pass the block_device that we plan to use this bio for and the operation to bio_init 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

Re: [dm-devel] [PATCH] dm rq: clear cloned bio ->bi_bdev to fix I/O accounting

2022-01-17 Thread Christoph Hellwig
On Tue, Jan 18, 2022 at 08:30:16AM +0800, Ming Lei wrote: > On Sun, Jan 16, 2022 at 11:51:17PM -0800, Christoph Hellwig wrote: > > So I actually noticed this during code inspection a while ago, but I > > think we need to use the actual underlying device instead of NULL here > &

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

2022-01-18 Thread Christoph Hellwig
On Mon, Jan 17, 2022 at 04:00:59PM +0200, Israel Rukshin wrote: > DM extension gives us several capabilities: > > 1. Use the Linux keyring and other key management tools. > >     - I used "keyctl padd user test-key @u < /tmp/wrapped_dek" at my tests Well, and kernel consumer can do that. > 2. S

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

2022-01-18 Thread Christoph Hellwig
On Tue, Jan 18, 2022 at 11:38:29AM -0800, Eric Biggers wrote: > I doubt that people would find Android's dm-default-key to be acceptable, > given > that it's a layering violation, and a similar approach was rejected in the > past > (https://lore.kernel.org/dm-devel/20170614234040.4326-1-mhalc...@

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

2022-01-18 Thread Christoph Hellwig
On Tue, Jan 18, 2022 at 12:27:33PM -0800, Eric Biggers wrote: > * The block device for a partition doesn't have its own request_queue or > queue_limits; those are properties of the disk, not the partition. But, > setting an encryption key may require changes to the queue_limits. For > examp

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

2022-01-20 Thread Christoph Hellwig
On Wed, Jan 19, 2022 at 01:20:54AM +0100, Jinpu Wang wrote: > this changes lead to IO error all the time, because bio_add_page return len. > We need if (bio_add_page(bio, virt_to_page(data), datalen, > offset_in_page(data)) < datalen) Does this version look good to you? http

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

2022-01-20 Thread Christoph Hellwig
On Tue, Jan 18, 2022 at 10:11:06PM +, Chaitanya Kulkarni wrote: > On 1/17/22 11:19 PM, Christoph Hellwig wrote: > > All callers need to set the block_device and operation, so lift that into > > the common code. > > > > Signed-off-by: Christoph Hellwig > > --

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

2022-01-20 Thread Christoph Hellwig
On Tue, Jan 11, 2022 at 11:59:23AM -0700, Jane Chu wrote: > In v3, dax recovery code path is independent of that of > normal write. Competing dax recovery threads are serialized, > racing read threads are guaranteed not overlapping with the > recovery process. > > In this phase, the recovery granu

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?

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

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

2022-01-24 Thread Christoph Hellwig
ahead which never sets PF_MEMALLOC and thus doesn't need the retry loop either. Both cases will never have __GFP_HIGH set. Signed-off-by: Christoph Hellwig --- fs/mpage.c | 35 ++- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/fs/mpage.c b/

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

[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

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

[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

[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

[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

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