dax fixes / cleanups: pmd vs thp, lifetime, and locking
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | ext2, ext4: warn when mounting with dax enabledfs/ fs/ | +7 | 0 replies | |
| 2/8 | dax: disable pmd mappingsfs/ fs/ | +10 | 1 reply | |
| 3/8 | mm, dax: fix DAX deadlocks (COW fault)mm/ | +4 | 0 replies | |
| 4/8 | mm, dax: truncate dax mappings at bdev or fs shutdownfs/ mm/ | +38 | 10 replies | |
| 5/8 | pmem, dax: clean up clear_pmem()arch/ fs/ | +2 | 0 replies | |
| 6/8 | dax: increase granularity of dax_clear_blocks() operationsfs/ | +8 | 0 replies | |
| 7/8 | dax: guarantee page aligned results from bdev_direct_access()fs/ fs/ | +2 | 0 replies | |
| 8/8 | dax: fix lifetime of in-kernel dax mappings with dax_map_atomic()block/ fs/ fs/ +1 more | +151 | 0 replies |
Reviews trailers per patch
6 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Jan Kara | Ross Zwisler | Jeff Moyer |
|---|---|---|---|
| 1/8 | A-b | ||
| 2/8 | A-b | ||
| 3/8 | A-b | ||
| 4/8 | |||
| 5/8 | R-b | R-b | |
| 6/8 | R-b | R-b | |
| 7/8 | |||
| 8/8 | 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/8] dax fixes / cleanups: pmd vs thp, lifetime, and locking
Changes since last posting [1]:
1/ Further cleanups to dax_clear_blocks(): Dropped increments of 'addr'
since we call bdev_direct_access() before the next use, and dropped the BUG_ON for sector unaligned return values from bdev_direct_access().
2/ In [PATCH 8/8] introduce blk_dax_ctl to remove the need to have
separate dax_map_atomic and __dax_map_atomic routines. Note, blk_dax_ctl is not passed through to drivers, it gets unpacked in bdev_direct_access. (Willy)
3/ New [PATCH 2/8]: Disable huge page dax mappings while we resolve
various crash scenarios in this development cycle.
4/ New [PATCH 4/8]: Unmap all dax mappings at block device shutdown
I have kept the reviewed-by's received to date, let me know if these incremental updates invalidate that review.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-November/002733.html
---
The first 4 patches in this series I consider 4.4-rc / -stable material. The rest are for 4.5. [PATCH 4/8] needs scrutiny. It is yet another example of where DAX behavior necessarily differs from page cache behavior. I still maintain that we should not be surprising unaware applications with DAX semantics, i.e. that DAX should be per-inode opt-in, not globally enabled for all inodes at fs mount time.
The largest patch in the set, [PATCH 8/8], addresses the lifetime of the 'addr' returned by bdev_direct_access. That address is only valid while the device driver is enabled. The new dax_map_atomic() / dax_unmap_atomic() pairing guarantees that 'addr' stays valid for the duration of that mapping.
While dax_map_atomic() protects against 'addr' going invalid, the new calls to truncate_pagecache() via invalidate_inodes() protect against the 'pfn' returned from bdev_direct_access() going invalid. Otherwise, the storage media can be directly accessed after the driver has been disabled.
---
[PATCH 1/8] ext2, ext4: warn when mounting with dax enabled [PATCH 2/8] dax: disable pmd mappings
[PATCH 3/8] mm, dax: fix DAX deadlocks (COW fault)
[PATCH 4/8] mm, dax: truncate dax mappings at bdev or fs shutdown [PATCH 5/8] pmem, dax: clean up clear_pmem()
[PATCH 6/8] dax: increase granularity of dax_clear_blocks() operations [PATCH 7/8] dax: guarantee page aligned results from bdev_direct_access() [PATCH 8/8] dax: fix lifetime of in-kernel dax mappings with dax_map_atomic()
arch/x86/include/asm/pmem.h | 7 - block/blk.h | 2 fs/Kconfig | 6 + fs/block_dev.c | 15 +-- fs/dax.c | 228 ++++++++++++++++++++++++++----------------- fs/ext2/super.c | 2 fs/ext4/super.c | 6 + fs/inode.c | 27 +++++ include/linux/blkdev.h | 19 +++- mm/memory.c | 8 +- mm/truncate.c | 13 ++ 11 files changed, 217 insertions(+), 116 deletions(-)