[dm-devel] [PATCH v4 1/7] pmem: Add functions for reading/writing page to/from pmem

2020-02-17 Thread Vivek Goyal
This splits pmem_do_bvec() into pmem_do_read() and pmem_do_write(). pmem_do_write() will be used by pmem zero_page_range() as well. Hence sharing the same code. Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 86 +--

[dm-devel] [PATCH v4 7/7] dax, iomap: Add helper dax_iomap_zero() to zero a range

2020-02-17 Thread Vivek Goyal
Add a helper dax_ioamp_zero() to zero a range. This patch basically merges __dax_zero_page_range() and iomap_dax_zero(). Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- fs/dax.c | 12 ++-- fs/iomap/buffered-io.c | 9 +

[dm-devel] [PATCH v4 5/7] dm, dax: Add dax zero_page_range operation

2020-02-17 Thread Vivek Goyal
This patch adds support for dax zero_page_range operation to dm targets. Signed-off-by: Vivek Goyal --- drivers/md/dm-linear.c| 21 + drivers/md/dm-log-writes.c| 19 +++ drivers/md/dm-stripe.c| 26 ++ drivers/md/dm.c

[dm-devel] [PATCH v4 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-17 Thread Vivek Goyal
Currently pmem_do_write() is written with assumption that all I/O is sector aligned. Soon I want to use this function in zero_page_range() where range passed in does not have to be sector aligned. Modify this function to be able to deal with an arbitrary range. Which is specified by pmem_off and l

[dm-devel] [PATCH v4 6/7] dax, iomap: Start using dax native zero_page_range()

2020-02-17 Thread Vivek Goyal
Get rid of calling block device interface for zeroing in iomap dax zeroing path and use dax native zeroing interface instead. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- fs/dax.c | 45 + 1 file change

[dm-devel] [PATCH v4 0/7] dax/pmem: Provide a dax operation to zero range of memory

2020-02-17 Thread Vivek Goyal
Hi, This is V4 of patches. These patches are also available at. https://github.com/rhvgoyal/linux/commits/dax-zero-range-v4 Changes since V3. - Rebased patches on top of 5.6-rc1 - Took care of some of the comments from Christoph. - Captured some Reviewed-by tags in some of the patches. Previ

[dm-devel] [PATCH v4 3/7] dax, pmem: Add a dax operation zero_page_range

2020-02-17 Thread Vivek Goyal
Add a dax operation zero_page_range, to zero a range of memory. This will also clear any poison in the range being zeroed. As of now, zeroing of up to one page is allowed in a single call. There are no callers which are trying to zero more than a page in a single call. Once we grow the callers whi

[dm-devel] [PATCH v4 4/7] s390, dcssblk, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-17 Thread Vivek Goyal
Add dax operation zero_page_range for dcssblk driver. CC: linux-s...@vger.kernel.org Suggested-by: Christoph Hellwig Reviewed-by: Gerald Schaefer Signed-off-by: Vivek Goyal --- drivers/s390/block/dcssblk.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/s390/bloc

Re: [dm-devel] [PATCH v3 1/7] pmem: Add functions for reading/writing page to/from pmem

2020-02-17 Thread Vivek Goyal
On Mon, Feb 17, 2020 at 05:21:38AM -0800, Christoph Hellwig wrote: > On Fri, Feb 07, 2020 at 03:26:46PM -0500, Vivek Goyal wrote: > > +static blk_status_t pmem_do_bvec(struct pmem_device *pmem, struct page > > *page, > > + unsigned int len, unsigned int off, unsigned int op, > >

Re: [dm-devel] [PATCH v3 3/7] dax, pmem: Add a dax operation zero_page_range

2020-02-17 Thread Vivek Goyal
On Mon, Feb 17, 2020 at 05:26:07AM -0800, Christoph Hellwig wrote: > > + int rc; > > + struct pmem_device *pmem = dax_get_private(dax_dev); > > + struct page *page = ZERO_PAGE(0); > > Nit: I tend to find code easier to read if variable declarations > with assignments are above those without.

Re: [dm-devel] [PATCH v3 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-17 Thread Vivek Goyal
On Mon, Feb 17, 2020 at 05:23:09AM -0800, Christoph Hellwig wrote: > On Fri, Feb 07, 2020 at 03:26:47PM -0500, Vivek Goyal wrote: > > Currently pmem_do_write() is written with assumption that all I/O is > > sector aligned. Soon I want to use this function in zero_page_range() > > where range passed

Re: [dm-devel] [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument

2020-02-17 Thread Christoph Hellwig
On Wed, Feb 12, 2020 at 12:07:28PM -0500, Vivek Goyal wrote: > Create a new helper dax_pgoff() which will replace bdev_dax_pgoff(). > Difference > between two is that dax_pgoff() takes in "sector_t dax_offset" as an argument > instead of "struct block_device". > > dax_offset specifies any offset

Re: [dm-devel] [PATCH 2/6] dax, iomap, ext4, ext2, xfs: Save dax_offset in "struct iomap"

2020-02-17 Thread Christoph Hellwig
On Wed, Feb 12, 2020 at 12:07:29PM -0500, Vivek Goyal wrote: > Add a new field "sector_t dax_offset" to "struct iomap". This will be > filled by filesystems and dax code will make use of this to convert > sector into page offset (dax_pgoff()), instead of bdev_dax_pgoff(). This > removes the depende

Re: [dm-devel] [PATCH v3 1/7] pmem: Add functions for reading/writing page to/from pmem

2020-02-17 Thread Christoph Hellwig
On Fri, Feb 07, 2020 at 03:26:46PM -0500, Vivek Goyal wrote: > +static blk_status_t pmem_do_bvec(struct pmem_device *pmem, struct page *page, > + unsigned int len, unsigned int off, unsigned int op, > + sector_t sector) > +{ > + if (!op_is_write(op)) > +

Re: [dm-devel] [PATCH v3 7/7] dax, iomap: Add helper dax_iomap_zero() to zero a range

2020-02-17 Thread Christoph Hellwig
On Fri, Feb 07, 2020 at 03:26:52PM -0500, Vivek Goyal wrote: > Add a helper dax_ioamp_zero() to zero a range. This patch basically > merges __dax_zero_page_range() and iomap_dax_zero(). > > Suggested-by: Christoph Hellwig > Signed-off-by: Vivek Goyal > --- > fs/dax.c | 12 ++--

Re: [dm-devel] [PATCH v3 6/7] dax, iomap: Start using dax native zero_page_range()

2020-02-17 Thread Christoph Hellwig
On Fri, Feb 07, 2020 at 03:26:51PM -0500, Vivek Goyal wrote: > Get rid of calling block device interface for zeroing in iomap dax > zeroing path and use dax native zeroing interface instead. > > Suggested-by: Christoph Hellwig > Signed-off-by: Vivek Goyal Looks good, Reviewed-by: Christoph Hel

Re: [dm-devel] [PATCH v3 3/7] dax, pmem: Add a dax operation zero_page_range

2020-02-17 Thread Christoph Hellwig
> + int rc; > + struct pmem_device *pmem = dax_get_private(dax_dev); > + struct page *page = ZERO_PAGE(0); Nit: I tend to find code easier to read if variable declarations with assignments are above those without. Also I don't think we need the page variable here. > + rc = pmem_d

Re: [dm-devel] [PATCH v3 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-17 Thread Christoph Hellwig
On Fri, Feb 07, 2020 at 03:26:47PM -0500, Vivek Goyal wrote: > Currently pmem_do_write() is written with assumption that all I/O is > sector aligned. Soon I want to use this function in zero_page_range() > where range passed in does not have to be sector aligned. > > Modify this function to be abl

[dm-devel] [PATCH] dm-integrity: fix invalid table returned

2020-02-17 Thread Mikulas Patocka
If the flag SB_FLAG_RECALCULATE is present in the superblock, but it was not specified on the command line (i.e. ic->recalculate_flag is false), dm-integrity would return invalid table line - the reported number of arguments would not match the real number. This patch fixes the argument mismatch.

[dm-devel] [PATCH v2] dm integrity: fix a deadlock due to offloading to an incorrect workqueue (fwd)

2020-02-17 Thread Mikulas Patocka
If we need to perform synchronous I/O in the function dm_integrity_map_continue, we must make sure that we are not in the map function - in order to avoid the deadlock due to bio queuing in generic_make_request. To avoid the deadlock, we offload the request to metadata_wq. However, metadata_wq als