dax, ext4, xfs: Synchronous page faults
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest18 patches 7 repliesIn review
- v517 patches 11 repliesSuperseded
- v417 patches 4 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 19 patches | 38 replies | Superseded | |
| v2 RFC | 13 patches | 38 replies | Superseded | |
| v1 RFC | 7 patches | 33 replies | Superseded |
Changes in v6 from the cover letter
* really updated the manpage
* improved comment describing IOMAP_F_DIRTY
* fixed XFS handling of VM_FAULT_NEEDSYNC in xfs_filemap_pfn_mkwrite()
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flagsarch/ arch/ arch/ +6 more | +61 | 5 replies | |
| 2/18 | mm: Remove VM_FAULT_HWPOISON_LARGE_MASKinclude/ | +0 | 0 replies | |
| 3/18 | dax: Simplify arguments of dax_insert_mapping()fs/ | +16 | 0 replies | |
| 4/18 | dax: Factor out getting of pfn out of iomapfs/ | +43 | 0 replies | |
| 5/18 | dax: Create local variable for VMA in dax_iomap_pte_fault()fs/ | +3 | 0 replies | |
| 6/18 | dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE testfs/ | +3 | 0 replies | |
| 7/18 | dax: Inline dax_insert_mapping() into the callsitefs/ | +19 | 0 replies | |
| 8/18 | dax: Inline dax_pmd_insert_mapping() into the callsitefs/ include/ | +19 | 0 replies | |
| 9/18 | dax: Fix comment describing dax_iomap_fault()fs/ | +2 | 0 replies | |
| 10/18 | dax: Allow dax_iomap_fault() to return pfnfs/ fs/ fs/ +2 more | +12 | 0 replies | |
| 11/18 | dax: Allow tuning whether dax_insert_mapping_entry() dirties entryfs/ | +7 | 0 replies | |
| 12/18 | mm: Define MAP_SYNC and VM_SYNC flagsfs/ include/ include/ +1 more | +9 | 0 replies | |
| 13/18 | dax, iomap: Add support for synchronous faultsfs/ include/ include/ | +47 | 0 replies | |
| 14/18 | dax: Implement dax_finish_sync_fault()fs/ include/ include/ | +87 | 0 replies | |
| 15/18 | ext4: Simplify error handling in ext4_dax_huge_fault()fs/ | +7 | 0 replies | |
| 16/18 | ext4: Support for synchronous DAX faultsfs/ fs/ fs/ +1 more | +47 | 0 replies | |
| 17/18 | xfs: Implement xfs_filemap_pfn_mkwrite() using __xfs_filemap_fault()fs/ fs/ | +4 | 1 reply | |
| 18/18 | xfs: support for synchronous DAX faultsfs/ fs/ | +19 | 1 reply |
Reviews trailers per patch
All 18 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Christoph Hellwig | Ross Zwisler | Darrick J. Wong |
|---|---|---|---|
| Series | R-b | ||
| 1/18 | R-b | ||
| 2/18 | R-b | R-b | |
| 3/18 | R-b | R-b | |
| 4/18 | R-b | R-b | |
| 5/18 | R-b | R-b | |
| 6/18 | R-b | R-b | |
| 7/18 | R-b | R-b | |
| 8/18 | R-b | R-b | |
| 9/18 | R-b | R-b | |
| 10/18 | R-b | R-b | |
| 11/18 | R-b | R-b | |
| 12/18 | R-b | R-b | |
| 13/18 | R-b | R-b | |
| 14/18 | R-b | R-b | |
| 15/18 | R-b | ||
| 16/18 | R-b | ||
| 17/18 | R-b | ||
| 18/18 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 0/18 v6] dax, ext4, xfs: Synchronous page faults
Hello,
here is the sixth 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.
I think we are ready to get this merged - I've talked to Dan and he said he could take the patches through his tree. It would just be nice to get final ack from Christoph for the first patch implementing MAP_VALIDATE and someone from XFS folks to check patch 17 (make xfs_filemap_pfn_mkwrite use __xfs_filemap_fault()).
---
We use a new mmap flag MAP_SYNC to indicate that page faults for the mapping should be synchronous. The guarantee provided by this flag is: While a block is writeably mapped into page tables of this mapping, it is guaranteed to be visible in the file at that offset also after a crash.
How I implement this is that ->iomap_begin() indicates by a flag that inode block mapping metadata is unstable and may need flushing (use the same test as whether fdatasync() has metadata to write). If yes, DAX fault handler refrains from inserting / write-enabling the page table entry and returns special flag VM_FAULT_NEEDDSYNC together with a PFN to map to the filesystem fault handler. The handler then calls fdatasync() (vfs_fsync_range()) for the affected range and after that calls DAX code to update the page table entry appropriately.
I did some basic performance testing on the patches over ramdisk - timed latency of page faults when faulting 512 pages. I did several tests: with file preallocated / with file empty, with background file copying going on / without it, with / without MAP_SYNC (so that we get comparison). The results are (numbers are in microseconds):
File preallocated, no background load no MAP_SYNC:
min=9 avg=10 max=46
8 - 15 us: 508
16 - 31 us: 3
32 - 63 us: 1
File preallocated, no background load, MAP_SYNC:
min=9 avg=10 max=47
8 - 15 us: 508
16 - 31 us: 2
32 - 63 us: 2
File empty, no background load, no MAP_SYNC:
min=21 avg=22 max=70
16 - 31 us: 506
32 - 63 us: 5
64 - 127 us: 1
File empty, no background load, MAP_SYNC:
min=40 avg=124 max=242
32 - 63 us: 1
64 - 127 us: 333
128 - 255 us: 178
File empty, background load, no MAP_SYNC:
min=21 avg=23 max=67
16 - 31 us: 507
32 - 63 us: 4
64 - 127 us: 1
File empty, background load, MAP_SYNC:
min=94 avg=112 max=181
64 - 127 us: 489
128 - 255 us: 23
So here we can see the difference between MAP_SYNC vs non MAP_SYNC is about 100-200 us when we need to wait for transaction commit in this setup.
Changes since v5:
* really updated the manpage
* improved comment describing IOMAP_F_DIRTY
* fixed XFS handling of VM_FAULT_NEEDSYNC in xfs_filemap_pfn_mkwrite()
Changes since v4:
* fixed couple of minor things in the manpage
* make legacy mmap flags always supported, remove them from mask declared to be supported by ext4 and xfs
Changes since v3:
* updated some changelogs
* folded fs support for VM_SYNC flag into patches implementing the functionality
* removed ->mmap_validate, use ->mmap_supported_flags instead
* added some Reviewed-by tags
* added manpage patch
Changes since v2:
* avoid unnecessary flushing of faulted page (Ross) - I've realized it makes no sense to remeasure my benchmark results (after actually doing that and seeing no difference, sigh) since I use ramdisk and not real PMEM HW and so flushes are ignored.
* handle nojournal mode of ext4
* other smaller cleanups & fixes (Ross)
* factor larger part of finishing of synchronous fault into a helper (Christoph)
* reorder pfnp argument of dax_iomap_fault() (Christoph)
* add XFS support from Christoph
* use proper MAP_SYNC support in mmap(2)
* rebased on top of 4.14-rc4
Changes since v1:
* switched to using mmap flag MAP_SYNC
* cleaned up fault handlers to avoid passing pfn in vmf->orig_pte
* switched to not touching page tables before we are ready to insert final entry as it was unnecessary and not really simplifying anything
* renamed fault flag to VM_FAULT_NEEDDSYNC
* other smaller fixes found by reviewers
Honza
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm