Re: [PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-24 Thread Dave Chinner
On Tue, Oct 24, 2017 at 05:24:14PM +0200, Jan Kara wrote: > From: Christoph Hellwig > > Return IOMAP_F_DIRTY from xfs_file_iomap_begin() when asked to prepare > blocks for writing and the inode is pinned, and has dirty fields other > than the timestamps. That's "fdatasync dirty",

[no subject]

2017-10-24 Thread Al Rayan Investment
please enjoy the new order. Faster delivery is in mid-November. Give me a good price, the deposit must be arranged in the 25th TH Thank you! ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 05:24:14PM +0200, Jan Kara wrote: > From: Christoph Hellwig > > Return IOMAP_F_DIRTY from xfs_file_iomap_begin() when asked to prepare > blocks for writing and the inode is pinned, and has dirty fields other > than the timestamps. In __xfs_filemap_fault() we

Re: [PATCH 01/17] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 05:23:58PM +0200, Jan Kara wrote: > From: Dan Williams > > The mmap(2) syscall suffers from the ABI anti-pattern of not validating > unknown flags. However, proposals like MAP_SYNC need a mechanism to > define new behavior that is known to fail

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 05:24:15PM +0200, Jan Kara wrote: > Signed-off-by: Jan Kara This looks unchanged since the previous version? > --- > man2/mmap.2 | 30 ++ > 1 file changed, 30 insertions(+) > > diff --git a/man2/mmap.2 b/man2/mmap.2 > index

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 03:22:23PM -0400, Mike Snitzer wrote: > On Fri, Oct 20 2017 at 1:24am -0400, > Ross Zwisler wrote: > > > Now that we have the ability log filesystem writes using a flat buffer, add > > support for DAX. Unfortunately we can't easily track

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-24 Thread Mike Snitzer
On Fri, Oct 20 2017 at 1:24am -0400, Ross Zwisler wrote: > Now that we have the ability log filesystem writes using a flat buffer, add > support for DAX. Unfortunately we can't easily track data that has been > written via mmap() now that the dax_flush()

Re: [PATCH 1/2] dm log writes: Add support for inline data buffers

2017-10-24 Thread Mike Snitzer
On Fri, Oct 20 2017 at 1:24am -0400, Ross Zwisler wrote: > Currently dm-log-writes supports writing filesystem data via BIOs, and > writing internal metadata from a flat buffer via write_metadata(). > > For DAX writes, though, we won't have a BIO, but will instead

[PATCH 14/17] dax: Implement dax_finish_sync_fault()

2017-10-24 Thread Jan Kara
Implement a function that filesystems can call to finish handling of synchronous page faults. It takes care of syncing appropriare file range and insertion of page table entry. Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by: Jan

[PATCH 13/17] dax, iomap: Add support for synchronous faults

2017-10-24 Thread Jan Kara
Add a flag to iomap interface informing the caller that inode needs fdstasync(2) for returned extent to become persistent and use it in DAX fault code so that we don't map such extents into page tables immediately. Instead we propagate the information that fdatasync(2) is necessary from

[PATCH 09/17] dax: Fix comment describing dax_iomap_fault()

2017-10-24 Thread Jan Kara
Add missing argument description. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index

[PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-24 Thread Jan Kara
From: Christoph Hellwig Return IOMAP_F_DIRTY from xfs_file_iomap_begin() when asked to prepare blocks for writing and the inode is pinned, and has dirty fields other than the timestamps. In __xfs_filemap_fault() we then detect this case and call dax_finish_sync_fault() to make sure

[PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Jan Kara
Signed-off-by: Jan Kara --- man2/mmap.2 | 30 ++ 1 file changed, 30 insertions(+) diff --git a/man2/mmap.2 b/man2/mmap.2 index 47c3148653be..598ff0c64f7f 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -125,6 +125,21 @@ are carried through to the

[PATCH 15/17] ext4: Simplify error handling in ext4_dax_huge_fault()

2017-10-24 Thread Jan Kara
If transaction starting fails, just bail out of the function immediately instead of checking for that condition throughout the function. Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/ext4/file.c | 13 +++-- 1 file changed, 7

[PATCH 06/17] dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test

2017-10-24 Thread Jan Kara
There are already two users and more are coming. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c

[PATCH 0/17 v5] dax, ext4, xfs: Synchronous page faults

2017-10-24 Thread Jan Kara
Hello, here is the fifth version of my patches to implement synchronous page faults for DAX mappings to make flushing of DAX mappings possible from userspace so that they can be flushed on finer than page granularity and also avoid the overhead of a syscall. We use a new mmap flag MAP_SYNC to

[PATCH 07/17] dax: Inline dax_insert_mapping() into the callsite

2017-10-24 Thread Jan Kara
dax_insert_mapping() has only one callsite and we will need to further fine tune what it does for synchronous faults. Just inline it into the callsite so that we don't have to pass awkward bools around. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler

[PATCH 08/17] dax: Inline dax_pmd_insert_mapping() into the callsite

2017-10-24 Thread Jan Kara
dax_pmd_insert_mapping() has only one callsite and we will need to further fine tune what it does for synchronous faults. Just inline it into the callsite so that we don't have to pass awkward bools around. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler

[PATCH 12/17] mm: Define MAP_SYNC and VM_SYNC flags

2017-10-24 Thread Jan Kara
Define new MAP_SYNC flag and corresponding VMA VM_SYNC flag. As the MAP_SYNC flag is not part of LEGACY_MAP_MASK, currently it will be refused by all MAP_SHARED_VALIDATE map attempts and silently ignored for everything else. Reviewed-by: Ross Zwisler Reviewed-by:

[PATCH 02/17] mm: Remove VM_FAULT_HWPOISON_LARGE_MASK

2017-10-24 Thread Jan Kara
It is unused. Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- include/linux/mm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[PATCH 03/17] dax: Simplify arguments of dax_insert_mapping()

2017-10-24 Thread Jan Kara
dax_insert_mapping() has lots of arguments and a lot of them is actuall duplicated by passing vm_fault structure as well. Change the function to take the same arguments as dax_pmd_insert_mapping(). Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig

[PATCH 01/17] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags

2017-10-24 Thread Jan Kara
From: Dan Williams The mmap(2) syscall suffers from the ABI anti-pattern of not validating unknown flags. However, proposals like MAP_SYNC need a mechanism to define new behavior that is known to fail on older kernels without the support. Define a new

[PATCH 04/17] dax: Factor out getting of pfn out of iomap

2017-10-24 Thread Jan Kara
Factor out code to get pfn out of iomap that is shared between PTE and PMD fault path. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 83

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 03:27:13PM +0200, Jan Kara wrote: > On Fri 20-10-17 15:47:53, Ross Zwisler wrote: > > On Thu, Oct 19, 2017 at 02:58:17PM +0200, Jan Kara wrote: > > > Signed-off-by: Jan Kara > > > --- > > > man2/mmap.2 | 30 ++ > > > 1 file

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Jan Kara
On Fri 20-10-17 15:47:53, Ross Zwisler wrote: > On Thu, Oct 19, 2017 at 02:58:17PM +0200, Jan Kara wrote: > > Signed-off-by: Jan Kara > > --- > > man2/mmap.2 | 30 ++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/man2/mmap.2 b/man2/mmap.2 >

Re: [PATCH 01/17] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags

2017-10-24 Thread Jan Kara
On Fri 20-10-17 00:27:07, Christoph Hellwig wrote: > > if (file) { > > struct inode *inode = file_inode(file); > > + unsigned long flags_mask = file->f_op->mmap_supported_flags; > > + > > + if (!flags_mask) > > + flags_mask = LEGACY_MAP_MASK; >