Re: [PATCH v10 4/7] dax: introduce DAX_RECOVERY_WRITE dax access mode

2022-05-16 Thread Vivek Goyal
ce > enum dax_access_mode { > DAX_ACCESS, > DAX_RECOVERY_WRITE, > } > where DAX_ACCESS is used for normal dax access, and > DAX_RECOVERY_WRITE is used for dax recovery write. > > Suggested-by: Dan Williams > Signed-off-by: Jane Chu > Revi

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

2021-12-15 Thread Vivek Goyal
On Tue, Dec 14, 2021 at 03:43:38PM -0800, Dan Williams wrote: > On Tue, Dec 14, 2021 at 12:33 PM Vivek Goyal wrote: > > > > On Tue, Dec 14, 2021 at 08:41:30AM -0800, Dan Williams wrote: > > > On Tue, Dec 14, 2021 at 6:23 AM Vivek Goyal wrote: > > > > > &

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

2021-12-15 Thread Vivek Goyal
On Wed, Dec 15, 2021 at 10:30:50AM +, Stefan Hajnoczi wrote: > On Tue, Dec 14, 2021 at 03:32:43PM -0500, Vivek Goyal wrote: > > On Tue, Dec 14, 2021 at 08:41:30AM -0800, Dan Williams wrote: > > > On Tue, Dec 14, 2021 at 6:23 AM Vivek Goyal wrote: > > > > > &g

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

2021-12-14 Thread Vivek Goyal
On Tue, Dec 14, 2021 at 08:41:30AM -0800, Dan Williams wrote: > On Tue, Dec 14, 2021 at 6:23 AM Vivek Goyal wrote: > > > > On Mon, Dec 13, 2021 at 09:23:18AM +0100, Christoph Hellwig wrote: > > > On Sun, Dec 12, 2021 at 06:44:26AM -0800, Dan Williams wrote: > > >

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

2021-12-14 Thread Vivek Goyal
On Mon, Dec 13, 2021 at 09:23:18AM +0100, Christoph Hellwig wrote: > 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 > &

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

2021-12-14 Thread Vivek Goyal
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 Vivek Goyal
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: > > > > On Thu, Dec 09, 2021 at 07:38:27AM +0100, Christoph Hellwig wrote: > > > These methods indirect the actual DAX read/write path. In the end pmem >

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

2021-12-10 Thread Vivek Goyal
_to_iter, > .zero_page_range = virtio_fs_zero_page_range, > }; > > @@ -853,7 +837,8 @@ static int virtio_fs_setup_dax(struct virtio_device > *vdev, struct virtio_fs *fs) > fs->dax_dev = alloc_dax(fs, &virtio_fs_dax_ops); > if (IS_ERR(fs->dax_dev)) &

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

2021-12-10 Thread Vivek Goyal
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 device > like virtiofs, I was wondering about that. Is it completely pointless. Typically we are just mapping host page cache into qemu address space. That s

Re: [dm-devel] [PATCH v5 4/8] dax, pmem: Add a dax operation zero_page_range

2020-04-01 Thread Vivek Goyal
On Tue, Mar 31, 2020 at 12:38:16PM -0700, Dan Williams wrote: > On Tue, Feb 18, 2020 at 1:49 PM Vivek Goyal wrote: > > > > 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

[dm-devel] [PATCH v6 7/6] dax: Move mandatory ->zero_page_range() check in alloc_dax()

2020-04-01 Thread Vivek Goyal
ilure. Right now it returns NULL and caller assumes failure happened due to -ENOMEM. But with this ->zero_page_range() check, I need to return -EINVAL instead. Signed-off-by: Vivek Goyal --- drivers/dax/bus.c|4 +++- drivers/dax/super.c | 14 +- drivers

Re: [dm-devel] [PATCH v5 4/8] dax, pmem: Add a dax operation zero_page_range

2020-04-01 Thread Vivek Goyal
On Tue, Mar 31, 2020 at 12:38:16PM -0700, Dan Williams wrote: > On Tue, Feb 18, 2020 at 1:49 PM Vivek Goyal wrote: > > > > 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

Re: [dm-devel] [PATCH v6 0/6] dax/pmem: Provide a dax operation to zero page range

2020-03-10 Thread Vivek Goyal
On Fri, Feb 28, 2020 at 11:34:50AM -0500, Vivek Goyal wrote: > Hi, > > This is V6 of patches. These patches are also available at. Hi Dan, Ping. Does this patch series look fine to you? Vivek > > Changes since V5: > > - Dan Williams preferred ->zero_page_range()

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

2020-03-04 Thread Vivek Goyal
On Sat, Feb 29, 2020 at 09:04:00AM +0100, Pankaj Gupta wrote: > On Fri, 28 Feb 2020 at 17:35, Vivek Goyal wrote: > > > > 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 >

[dm-devel] [PATCH v6 0/6] dax/pmem: Provide a dax operation to zero page range

2020-02-28 Thread Vivek Goyal
on at the end of the operation. Christoph, I have dropped your Reviewed-by tag on 1-2 patches because these patches changed substantially. Especially signature of of dax zero_page_range() helper. Thanks Vivek Vivek Goyal (6): pmem: Add functions for reading/writing page to/from pmem dax, pm

[dm-devel] [PATCH v6 4/6] dm, dax: Add dax zero_page_range operation

2020-02-28 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| 18 ++ drivers/md/dm-log-writes.c| 17 + drivers/md/dm-stripe.c| 23 +++ drivers/md/dm.c

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

2020-02-28 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 | 16 fs/iomap/buffered-io.c | 9

[dm-devel] [PATCH v6 3/6] s390, dcssblk, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-28 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 | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/s390/block

[dm-devel] [PATCH v6 5/6] dax: Use new dax zero page method for zeroing a page

2020-02-28 Thread Vivek Goyal
Use new dax native zero page method for zeroing page if I/O is page aligned. Otherwise fall back to direct_access() + memcpy(). This gets rid of one of the depenendency on block device in dax path. Signed-off-by: Vivek Goyal --- fs/dax.c | 53

[dm-devel] [PATCH v6 2/6] dax, pmem: Add a dax operation zero_page_range

2020-02-28 Thread Vivek Goyal
() on individual targets. Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 20 drivers/nvdimm/pmem.c | 11 +++ include/linux/dax.h | 4 3 files changed, 35 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax

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

2020-02-28 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 Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 86

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-27 Thread Vivek Goyal
On Thu, Feb 27, 2020 at 02:11:43PM +1100, Dave Chinner wrote: > On Wed, Feb 26, 2020 at 11:57:56AM -0500, Vivek Goyal wrote: > > On Tue, Feb 25, 2020 at 02:49:30PM -0800, Dan Williams wrote: > > [..] > > > > > I'm ok with replacing blkdev_issue_zeroout() with

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-26 Thread Vivek Goyal
On Tue, Feb 25, 2020 at 02:49:30PM -0800, Dan Williams wrote: [..] > > > I'm ok with replacing blkdev_issue_zeroout() with a dax operation > > > callback that deals with page aligned entries. That change at least > > > makes the error boundary symmetric across copy_from_iter() and the > > > zeroing

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-26 Thread Vivek Goyal
On Tue, Feb 25, 2020 at 02:49:30PM -0800, Dan Williams wrote: [..] > > > > Hi Dan, > > > > > > > > IIUC, block aligned hole punch don't go through __dax_zero_page_range() > > > > path. Instead they call blkdev_issue_zeroout() at later point of time. > > > > > > > > Only partial block zeroing path i

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-25 Thread Vivek Goyal
On Tue, Feb 25, 2020 at 08:25:27AM -0800, Dan Williams wrote: > On Tue, Feb 25, 2020 at 5:37 AM Vivek Goyal wrote: > > > > On Mon, Feb 24, 2020 at 01:32:58PM -0800, Dan Williams wrote: > > > > [..] > > > > > > Ok, how about if I add one more patch

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-25 Thread Vivek Goyal
On Mon, Feb 24, 2020 at 01:32:58PM -0800, Dan Williams wrote: [..] > > > > Ok, how about if I add one more patch to the series which will check > > > > if unwritten portion of the page has known poison. If it has, then > > > > -EIO is returned. > > > > > > > > > > > > Subject: pmem: zero page rang

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-24 Thread Vivek Goyal
On Mon, Feb 24, 2020 at 12:52:13PM -0800, Dan Williams wrote: > On Mon, Feb 24, 2020 at 12:13 PM Vivek Goyal wrote: > > > > On Mon, Feb 24, 2020 at 10:03:30AM +1100, Dave Chinner wrote: > > > On Fri, Feb 21, 2020 at 03:17:59PM -0500, Vivek Goyal wrote: > > > >

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-24 Thread Vivek Goyal
On Mon, Feb 24, 2020 at 10:03:30AM +1100, Dave Chinner wrote: > On Fri, Feb 21, 2020 at 03:17:59PM -0500, Vivek Goyal wrote: > > On Fri, Feb 21, 2020 at 01:32:48PM -0500, Jeff Moyer wrote: > > > Vivek Goyal writes: > > > > > > > On Thu, Feb 20, 202

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-24 Thread Vivek Goyal
On Mon, Feb 24, 2020 at 10:03:30AM +1100, Dave Chinner wrote: [..] > > > > Hi Jeff, > > > > > > > > New dax zeroing interface (dax_zero_page_range()) can technically pass > > > > a range which is less than a sector. Or which is bigger than a sector > > > > but start and end are not aligned on sect

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-21 Thread Vivek Goyal
On Fri, Feb 21, 2020 at 01:00:29PM -0800, Dan Williams wrote: > On Fri, Feb 21, 2020 at 12:18 PM Vivek Goyal wrote: > > > > On Fri, Feb 21, 2020 at 01:32:48PM -0500, Jeff Moyer wrote: > > > Vivek Goyal writes: > > > > > > > On Thu, Feb 2

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-21 Thread Vivek Goyal
On Fri, Feb 21, 2020 at 01:32:48PM -0500, Jeff Moyer wrote: > Vivek Goyal writes: > > > On Thu, Feb 20, 2020 at 04:35:17PM -0500, Jeff Moyer wrote: > >> Vivek Goyal writes: > >> > >> > Currently pmem_clear_poison() expects offset and len to be sector

Re: [dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-20 Thread Vivek Goyal
On Thu, Feb 20, 2020 at 04:35:17PM -0500, Jeff Moyer wrote: > Vivek Goyal writes: > > > Currently pmem_clear_poison() expects offset and len to be sector aligned. > > Atleast that seems to be the assumption with which code has been written. > > It is called only from

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

2020-02-18 Thread Vivek Goyal
/20200203200029.4592-1-vgo...@redhat.com/ v1: https://lore.kernel.org/linux-fsdevel/20200123165249.ga7...@redhat.com/ Thanks Vivek Vivek Goyal (8): pmem: Add functions for reading/writing page to/from pmem drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len pmem: Enable

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

2020-02-18 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 Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 86

[dm-devel] [PATCH v5 6/8] dm, dax: Add dax zero_page_range operation

2020-02-18 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-devel] [PATCH v5 4/8] dax, pmem: Add a dax operation zero_page_range

2020-02-18 Thread Vivek Goyal
zero_page_range() on individual targets. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 19 +++ drivers/nvdimm/pmem.c | 10 ++ include/linux/dax.h | 3 +++ 3 files changed, 32 insertions(+) diff

[dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-18 Thread Vivek Goyal
. Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 075b11682192..e72959203253 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -74,14 +74,28

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

2020-02-18 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

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

2020-02-18 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 v5 5/8] s390, dcssblk, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-18 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

[dm-devel] [PATCH v5 3/8] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-18 Thread Vivek Goyal
len. Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index e72959203253..3c46e9e6d04c 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c

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

2020-02-18 Thread Vivek Goyal
On Tue, Feb 18, 2020 at 09:09:28AM -0800, Christoph Hellwig wrote: > On Mon, Feb 17, 2020 at 01:16:48PM -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()

[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-devel] [PATCH v4 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-17 Thread Vivek Goyal
len. Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 075b11682192..fae8f67da9de 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm

[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

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

2020-02-17 Thread Vivek Goyal
. Previous version of patches are here. v3: https://lore.kernel.org/linux-fsdevel/20200214125717.ga18...@redhat.com/T/#t v2: https://lore.kernel.org/linux-fsdevel/20200203200029.4592-1-vgo...@redhat.com/ v1: https://lore.kernel.org/linux-fsdevel/20200123165249.ga7...@redhat.com/ Thanks Vivek Vivek Goyal

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

2020-02-17 Thread Vivek Goyal
zero_page_range() on individual targets. Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 19 +++ drivers/nvdimm/pmem.c | 11 +++ include/linux/dax.h | 3 +++ 3 files changed, 33 insertions(+) diff --git a/drivers/dax/super.c b

[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

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

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()

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

2020-02-14 Thread Vivek Goyal
On Fri, Feb 07, 2020 at 03:26:45PM -0500, Vivek Goyal wrote: > Hi, > > This is V3 of patches. I have dropped RFC tag from the series as it > looks like there is agreement on the interface. These patches are also > available at. Hi Dan, Christoph, Ping for this patch series. How d

[dm-devel] [PATCH 6/6] dax: Remove bdev_dax_pgoff() helper

2020-02-12 Thread Vivek Goyal
Now there don't seem to be anyuser of bdev_dax_pgoff(). All users have been moved to dax_pgoff(). So remove this helper. Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 13 - include/linux/dax.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/dax/supe

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

2020-02-12 Thread Vivek Goyal
le calculating pgoff. Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 12 include/linux/dax.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0aa4b6bc5101..e9daa30e4250 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/sup

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

2020-02-12 Thread Vivek Goyal
operations. Signed-off-by: Vivek Goyal --- fs/ext2/inode.c | 1 + fs/ext4/inode.c | 1 + fs/xfs/xfs_iomap.c| 2 ++ include/linux/iomap.h | 1 + 4 files changed, 5 insertions(+) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index c885cf7d724b..5c3379e78d49 100644 --- a/fs/ext2/i

[dm-devel] [PATCH 4/6] dax, dm/md: Use dax_pgoff() instead of bdev_dax_pgoff()

2020-02-12 Thread Vivek Goyal
Replace usage of bdev_dax_pgoff() with dax_pgoff(). Signed-off-by: Vivek Goyal --- drivers/md/dm-linear.c | 9 ++--- drivers/md/dm-log-writes.c | 9 ++--- drivers/md/dm-stripe.c | 8 +--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm-linear.c

[dm-devel] [PATCH 5/6] drivers/dax: Use dax_pgoff() instead of bdev_dax_pgoff()

2020-02-12 Thread Vivek Goyal
Start using dax_pgoff() instead of bdev_dax_pgoff(). Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index e9daa30e4250..ee35ecc61545 100644 --- a/drivers/dax/super.c +++ b

[dm-devel] [PATCH 3/6] fs/dax.c: Start using dax_pgoff() instead of bdev_dax_pgoff()

2020-02-12 Thread Vivek Goyal
Replace usage of bdev_dax_pgoff() with dax_pgoff() in fs/dax.c Signed-off-by: Vivek Goyal --- fs/dax.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 35da144375a0..921042a81538 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -680,7 +680,7

[dm-devel] [RFC PATCH 0/6] dax: Replace bdev_dax_pgoff() with dax_pgoff()

2020-02-12 Thread Vivek Goyal
evice. So I am posting this RFC patch series, which is just boot tested. Any feedback or comments are welcome. Thanks Vivek Vivek Goyal (6): dax: Define a helper dax_pgoff() which takes in dax_offset as argument dax,iomap,ext4,ext2,xfs: Save dax_offset in "struct iomap" fs/dax

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

2020-02-11 Thread Vivek Goyal
On Mon, Feb 10, 2020 at 09:53:15PM +0100, Gerald Schaefer wrote: > On Fri, 7 Feb 2020 15:26:49 -0500 > Vivek Goyal wrote: > > > Add dax operation zero_page_range for dcssblk driver. > > > > CC: linux-s...@vger.kernel.org > > Suggested-by: Christoph Hellwi

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

2020-02-07 Thread Vivek Goyal
len. Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 9ad07cb8c9fc..281fe04d25fd 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm

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

2020-02-07 Thread Vivek Goyal
zero_page_range() on individual targets. Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 19 +++ drivers/nvdimm/pmem.c | 15 +++ include/linux/dax.h | 3 +++ 3 files changed, 37 insertions(+) diff --git a/drivers/dax/super.c b

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

2020-02-07 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 Signed-off-by: Vivek Goyal --- fs/dax.c | 45 + 1 file changed, 9 insertions(+), 36

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

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

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

2020-02-07 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-devel] [PATCH v3 7/7] dax, iomap: Add helper dax_iomap_zero() to zero a range

2020-02-07 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 Signed-off-by: Vivek Goyal --- fs/dax.c | 12 ++-- fs/iomap/buffered-io.c | 9 + include/linux/dax.h| 17

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

2020-02-07 Thread Vivek Goyal
interface only supports zeroing with-in page. - Refactored pmem_do_bvec() and reused write side of code in zero_page_range(). - Removed generic_dax_zero_page_range() - Fixed s390 dcssblk.c compilation issue. Please review. Thanks Vivek Vivek Goyal (7): pmem: Add functions for reading/writing page

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

2020-02-07 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 | 79

Re: [dm-devel] [PATCH 1/5] dax, pmem: Add a dax operation zero_page_range

2020-02-07 Thread Vivek Goyal
On Fri, Feb 07, 2020 at 08:57:39AM -0800, Dan Williams wrote: > On Wed, Feb 5, 2020 at 11:41 PM Christoph Hellwig wrote: > > > > On Wed, Feb 05, 2020 at 04:40:44PM -0800, Dan Williams wrote: > > > > I don't have any reason not to pass phys_addr_t. If that sounds better, > > > > will make changes.

Re: [dm-devel] [PATCH 3/5] dm, dax: Add dax zero_page_range operation

2020-02-07 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:33:04AM -0800, Christoph Hellwig wrote: > On Mon, Feb 03, 2020 at 03:00:27PM -0500, Vivek Goyal wrote: > > This patch adds support for dax zero_page_range operation to dm targets. > > Any way to share the code with the dax copy iter here? Had a look

Re: [dm-devel] [PATCH 4/5] dax, iomap: Start using dax native zero_page_range()

2020-02-07 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:33:56AM -0800, Christoph Hellwig wrote: > On Mon, Feb 03, 2020 at 03:00:28PM -0500, Vivek Goyal wrote: > > + id = dax_read_lock(); > > + rc = dax_zero_page_range(dax_dev, pgoff, offset, size); > > + dax_read_unlock(id); > > + retu

Re: [dm-devel] [PATCH 1/5] dax, pmem: Add a dax operation zero_page_range

2020-02-06 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 04:40:44PM -0800, Dan Williams wrote: > On Wed, Feb 5, 2020 at 12:03 PM Vivek Goyal wrote: > > > > On Wed, Feb 05, 2020 at 10:30:50AM -0800, Christoph Hellwig wrote: > > > > + /* > > > > +* There are no users as of

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

2020-02-05 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:36:09AM -0800, Christoph Hellwig wrote: > > +int dax_iomap_zero(loff_t pos, unsigned offset, unsigned size, > > + struct iomap *iomap) > > { > > pgoff_t pgoff; > > long rc, id; > > + sector_t sector = iomap_sector(iomap, pos & PAGE_MASK)

Re: [dm-devel] [PATCH 4/5] dax, iomap: Start using dax native zero_page_range()

2020-02-05 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:33:56AM -0800, Christoph Hellwig wrote: > On Mon, Feb 03, 2020 at 03:00:28PM -0500, Vivek Goyal wrote: > > + id = dax_read_lock(); > > + rc = dax_zero_page_range(dax_dev, pgoff, offset, size); > > + dax_read_unlock(id); > > + retu

Re: [dm-devel] [PATCH 2/5] s390, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-05 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:32:05AM -0800, Christoph Hellwig wrote: > > diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c > > index 63502ca537eb..f6709200bcd0 100644 > > --- a/drivers/s390/block/dcssblk.c > > +++ b/drivers/s390/block/dcssblk.c > > @@ -62,6 +62,7 @@ static cons

Re: [dm-devel] [PATCH 1/5] dax, pmem: Add a dax operation zero_page_range

2020-02-05 Thread Vivek Goyal
On Wed, Feb 05, 2020 at 10:30:50AM -0800, Christoph Hellwig wrote: > > + /* > > +* There are no users as of now. Once users are there, fix dm code > > +* to be able to split a long range across targets. > > +*/ > > This comment confused me. I think this wants to say something like:

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

2020-02-03 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| 18 ++ drivers/md/dm-log-writes.c| 17 + drivers/md/dm-stripe.c| 23 +++ drivers/md/dm.c

[dm-devel] [PATCH 2/5] s390, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-03 Thread Vivek Goyal
Add dax operation zero_page_range. This just calls generic helper generic_dax_zero_page_range(). Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/s390/block/dcssblk.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390

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

2020-02-03 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 Signed-off-by: Vivek Goyal --- fs/dax.c | 12 ++-- fs/iomap/buffered-io.c | 9 + include/linux/dax.h| 11

[dm-devel] [RFC PATCH 0/5][V2] dax, pmem: Provide a dax operation to zero range of memory

2020-02-03 Thread Vivek Goyal
for zeroing a range, it can help with not having to call blkdev_issue_zeroout() in dax path. Thanks Vivek Vivek Goyal (5): dax, pmem: Add a dax operation zero_page_range s390,dax: Add dax zero_page_range operation to dcssblk driver dm,dax: Add dax zero_page_range operation dax,iomap: St

[dm-devel] [PATCH 1/5] dax, pmem: Add a dax operation zero_page_range

2020-02-03 Thread Vivek Goyal
zero_page_range() on individual targets. Suggested-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 20 + drivers/nvdimm/pmem.c | 50 +++ fs/dax.c | 15 + include/linux/dax.h | 6

[dm-devel] [PATCH 4/5] dax, iomap: Start using dax native zero_page_range()

2020-02-03 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 Signed-off-by: Vivek Goyal --- fs/dax.c | 45 + 1 file changed, 9 insertions(+), 36

[dm-devel] [PATCH][V2] dm, dax: Make sure dm_dax_flush() is called if device supports it

2017-07-26 Thread Vivek Goyal
Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 6 ++ drivers/md/dm-table.c | 35 +++ include/linux/dax.h | 1 + 3 files changed, 42 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ce9e563..938eb48 100644 --- a/drivers/dax

Re: [dm-devel] dm, dax: Make sure dm_dax_flush() is called if device supports it

2017-07-25 Thread Vivek Goyal
On Tue, Jul 25, 2017 at 04:46:09PM -0400, Mike Snitzer wrote: > On Tue, Jul 25 2017 at 3:43pm -0400, > Vivek Goyal wrote: > > > Right now, dm_dax_flush() is not being called and I think it is not being > > called becuase DAXDEV_WRITE_CACHE is not set on dm dax device. >

Re: [dm-devel] [PATCH] dm, dax: Make sure dm_dax_flush() is called if device supports it

2017-07-25 Thread Vivek Goyal
On Tue, Jul 25, 2017 at 01:43:27PM -0700, Dan Williams wrote: > On Tue, Jul 25, 2017 at 12:43 PM, Vivek Goyal wrote: > > Right now, dm_dax_flush() is not being called and I think it is not being > > called becuase DAXDEV_WRITE_CACHE is not set on dm dax device. > > > &g

[dm-devel] [PATCH] dm, dax: Make sure dm_dax_flush() is called if device supports it

2017-07-25 Thread Vivek Goyal
Right now, dm_dax_flush() is not being called and I think it is not being called becuase DAXDEV_WRITE_CACHE is not set on dm dax device. If underlying dax device supports write cache, set DAXDEV_WRITE_CACHE on dm dax device. This will get dm_dax_flush() being called. Signed-off-by: Vivek Goyal

Re: [dm-devel] [PATCH RFC 0/4] dm thin: support blk-throttle on data and metadata device

2017-01-20 Thread Vivek Goyal
On Fri, Jan 20, 2017 at 10:19:22AM -0500, Jeff Moyer wrote: > Hou Tao writes: > > > Hi all, > > > > We need to throttle the O_DIRECT IO on data and metadata device > > of a dm-thin pool and encounter some problems. If we set the > > limitation on the root blkcg, the throttle works. If we set the

Re: [dm-devel] question about block-throttle on data device of dm-thin pool

2017-01-10 Thread Vivek Goyal
On Tue, Jan 10, 2017 at 02:47:02PM +0800, Hou Tao wrote: > Hi, all. > > I am trying to test block-throttle on dm-thin devices. I find the throttling > on dm-thin device is OK, but the throttling doesn't work for the data device > of dm-thin pool. > > The following is my test case: > #!/bin/sh >

Re: [dm-devel] [PATCH] block: transfer source bio's cgroup tags to clone via bio_associate_blkcg()

2016-03-02 Thread Vivek Goyal
On Wed, Mar 02, 2016 at 04:04:05PM -0500, Vivek Goyal wrote: > On Wed, Mar 02, 2016 at 02:34:50PM -0600, Chris Friesen wrote: > > On 03/02/2016 02:10 PM, Vivek Goyal wrote: > > >On Wed, Mar 02, 2016 at 09:59:13PM +0200, Nikolay Borisov wrote: > > > > >We had simi

Re: [dm-devel] [PATCH] block: transfer source bio's cgroup tags to clone via bio_associate_blkcg()

2016-03-02 Thread Vivek Goyal
On Wed, Mar 02, 2016 at 02:34:50PM -0600, Chris Friesen wrote: > On 03/02/2016 02:10 PM, Vivek Goyal wrote: > >On Wed, Mar 02, 2016 at 09:59:13PM +0200, Nikolay Borisov wrote: > > >We had similar issue with IO priority and it did not work reliably with > >CFQ on underlyin

Re: [dm-devel] [PATCH] block: transfer source bio's cgroup tags to clone via bio_associate_blkcg() (was: Re: blkio cgroups controller doesn't work with LVM?)

2016-03-02 Thread Vivek Goyal
On Wed, Mar 02, 2016 at 10:19:38PM +0200, Nikolay Borisov wrote: > On Wednesday, March 2, 2016, Vivek Goyal wrote: > > > On Wed, Mar 02, 2016 at 09:59:13PM +0200, Nikolay Borisov wrote: > > > On Wednesday, March 2, 2016, Vivek Goyal > > wrote: > > > > &

Re: [dm-devel] [PATCH] block: transfer source bio's cgroup tags to clone via bio_associate_blkcg() (was: Re: blkio cgroups controller doesn't work with LVM?)

2016-03-02 Thread Vivek Goyal
On Wed, Mar 02, 2016 at 09:59:13PM +0200, Nikolay Borisov wrote: > On Wednesday, March 2, 2016, Vivek Goyal wrote: > > > On Wed, Mar 02, 2016 at 08:03:10PM +0200, Nikolay Borisov wrote: > > > Thanks for the patch I will likely have time to test this sometime next > >

Re: [dm-devel] [PATCH] block: transfer source bio's cgroup tags to clone via bio_associate_blkcg() (was: Re: blkio cgroups controller doesn't work with LVM?)

2016-03-02 Thread Vivek Goyal
On Wed, Mar 02, 2016 at 08:03:10PM +0200, Nikolay Borisov wrote: > Thanks for the patch I will likely have time to test this sometime next week. > But just to be sure - the expected behavior would be that processes > writing to dm-based devices would experience the fair-shair > scheduling of CFQ (p

Re: [dm-devel] blkio cgroups controller doesn't work with LVM?

2016-02-26 Thread Vivek Goyal
Looks like Tejun's email id in original email is wrong. It should be t...@kernel.org and not te...@kernel.org. Fixing it. Thanks Vivek On Fri, Feb 26, 2016 at 11:42:28AM -0500, Vivek Goyal wrote: > On Thu, Feb 25, 2016 at 09:53:14AM -0500, Mike Snitzer wrote: > > On Thu, Feb 25 2

Re: [dm-devel] blkio cgroups controller doesn't work with LVM?

2016-02-26 Thread Vivek Goyal
On Thu, Feb 25, 2016 at 09:53:14AM -0500, Mike Snitzer wrote: > On Thu, Feb 25 2016 at 2:48am -0500, > Nikolay Borisov wrote: > > > > > > > On 02/24/2016 08:12 PM, Chris Friesen wrote: > > > > > > Hi, > > > > > > Are there known limitations with the blkio cgroup controller when used > > > wi