Skip to content

DAX: Page cache bypass for filesystems on memory storage

Matthew Wilcox linux-fsdevel linux-mm lkml stable 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v12 Latest20 patches 40 repliesIn review
  2. v1121 patches 66 repliesSuperseded
  3. v1021 patches 29 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v922 patches1 replySuperseded
v822 patches38 repliesSuperseded
v722 patches67 repliesApplied
v622 patches16 repliesSuperseded
v522 patches22 repliesSuperseded
v422 patches7 repliesSuperseded
v33 patches32 repliesSuperseded

Changes in v12 from the cover letter

- Rebased to 3.18-rc1, dropping patch "vfs: Add copy_to_iter(), copy_from_iter() and iov_iter_zero()" as it was merged through Al's tree.
- Added cc to [email protected] on patch 1
- Fixed comment style in brd.c (Mathieu)
- Make more functions in fs.h common with and without CONFIG_FS_DAX set
- Improve type-checking with !CONFIG_FS_DAX
- Simplify check for holes in dax_io()
- Harden the loop in dax_clear_blocks()
- Add missing check against truncate of a page covering a hole
- Fix the page-fault handler to work for block devices too
- Change a few more places that mentioned 'XIP' into 'DAX'
- Update DAX documentation in a couple of places

Patches in v12 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20axonram: Fix bug in direct_accessarch/powerpc/sysdev/axonram.c+1 -10 replies
2/20block: Change direct_access calling conventionDocumentation/filesystems/xip.txt arch/powerpc/sysdev/axonram.c drivers/block/brd.c +4 more+86 -580 replies
3/20mm: Fix XIP fault vs truncate racemm/filemap_xip.c+22 -22 replies
4/20mm: Allow page fault handlers to perform the COWinclude/linux/mm.h mm/memory.c+25 -95 replies
5/20vfs,ext2: Introduce IS_DAX(inode)fs/ext2/inode.c fs/ext2/xip.h include/linux/fs.h +1 more+24 -120 replies
6/20dax,ext2: Replace XIP read and write with DAX I/OMAINTAINERS fs/Makefile fs/dax.c +5 more+214 -2452 replies
7/20dax,ext2: Replace ext2_clear_xip_target with dax_clear_blocksfs/dax.c fs/ext2/inode.c fs/ext2/xip.c +2 more+43 -202 replies
8/20dax,ext2: Replace the XIP page fault handler with the DAX page fault handlerfs/dax.c fs/ext2/file.c include/linux/fs.h +1 more+273 -2093 replies
9/20dax,ext2: Replace xip_truncate_page with dax_truncate_pagefs/dax.c fs/ext2/inode.c include/linux/fs.h +1 more+46 -502 replies
10/20dax: Replace XIP documentation with DAX documentationDocumentation/filesystems/00-INDEX Documentation/filesystems/dax.txt Documentation/filesystems/xip.txt+92 -739 replies
11/20vfs: Remove get_xip_memDocumentation/filesystems/Locking Documentation/filesystems/vfs.txt fs/exofs/inode.c +10 more+7 -940 replies
12/20ext2: Remove ext2_xip_verify_sb()fs/ext2/super.c fs/ext2/xip.c fs/ext2/xip.h+12 -350 replies
13/20ext2: Remove ext2_use_xipfs/ext2/ext2.h fs/ext2/inode.c fs/ext2/namei.c+7 -30 replies
14/20ext2: Remove xip.c and xip.hfs/ext2/Makefile fs/ext2/inode.c fs/ext2/namei.c +3 more+0 -350 replies
15/20vfs,ext2: Remove CONFIG_EXT2_FS_XIP and rename CONFIG_FS_XIP to CONFIG_FS_DAXfs/Kconfig fs/Makefile fs/ext2/Kconfig +5 more+21 -260 replies
16/20ext2: Remove ext2_aops_xipfs/ext2/ext2.h fs/ext2/inode.c fs/ext2/namei.c+3 -90 replies
17/20ext2: Get rid of most mentions of XIP in ext2Documentation/filesystems/ext2.txt fs/ext2/ext2.h fs/ext2/file.c +3 more+34 -250 replies
18/20dax: Add dax_zero_page_rangeDocumentation/filesystems/dax.txt fs/dax.c include/linux/fs.h+33 -52 replies
19/20ext4: Add DAX functionalityDocumentation/filesystems/dax.txt Documentation/filesystems/ext4.txt fs/ext4/ext4.h +5 more+180 -370 replies
20/20brd: Rename XIP to DAXdrivers/block/Kconfig drivers/block/brd.c+14 -130 replies

Reviews trailers per patch

14 of 20 patches have a Reviewed-by or Acked-by.

PatchJan KaraMathieu DesnoyersBoaz HarroshKirill A. ShutemovRoss ZwislerRandy DunlapAndreas Dilger
1/20R-b R-b
2/20R-b R-b
3/20R-b R-b A-b
4/20A-b
5/20R-b R-b
6/20R-b R-b
7/20
8/20R-b
9/20R-b
10/20R-b
11/20
12/20
13/20R-b
14/20R-b
15/20
16/20R-b
17/20R-b
18/20
19/20R-b
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v12 thread

Cover letter [PATCH v12 00/20] DAX: Page cache bypass for filesystems on memory storage

DAX is a replacement for the variation of XIP currently supported by the ext2 filesystem. We have three different things in the tree called 'XIP', and the new focus is on access to data rather than executables, so a name change was in order. DAX stands for Direct Access. The X is for eXciting.

The new focus on data access has resulted in more careful attention to races that exist in the current XIP code, but are not hit by the use-case that it was designed for. XIP's architecture worked fine for ext2, but DAX is architected to work with modern filsystems such as ext4 and XFS. DAX is not intended for use with btrfs; the value that btrfs adds relies on manipulating data and writing data to different locations, while DAX's value is for write-in-place and keeping the kernel from touching the data.

DAX was developed in order to support NV-DIMMs, but it's become clear that its usefuless extends beyond NV-DIMMs and there are several potential customers including the tracing machinery. Other people want to place the kernel log in an area of memory, as long as they have a BIOS that does not clear DRAM on reboot.

Patch 1 is a bug fix. It is obviously correct, and should be included into 3.18.

Patch 2 starts the transformation by changing how ->direct_access works. Much code is moved from the drivers and filesystems into the block layer, and we add the flexibility of being able to map more than one page at a time. It would be good to get this patch into 3.18 as it is also useful for people who are pursuing non-DAX approaches to working with persistent memory.

Patch 3 is also a bug fix, probably worth including in 3.18.

Patches 4 & 5 are infrastructure for DAX.

Patches 6-10 replace the XIP code with its DAX equivalents, transforming ext2 to use the DAX code as we go. Note that patch 10 is the Documentation patch.

Patches 11-17 clean up after the XIP code, removing the infrastructure that is no longer needed and renaming various XIP things to DAX. Most of these patches were added after Jan found things he didn't like in an earlier version of the ext4 patch ... that had been copied from ext2. So ext2 i being transformed to do things the same way that ext4 will later. The ability to mount ext2 filesystems with the 'xip' option is retained, although the 'dax' option is now preferred.

Patch 18 adds some DAX infrastructure to support ext4.

Patch 19 adds DAX support to ext4. It is broadly similar to ext2's DAX support, but it is more efficient than ext4's due to its support for unwritten extents.

Patch 20 is another cleanup patch renaming XIP to DAX.

My thanks to Mathieu Desnoyers for his reviews of the v11 patchset. Most of the changes below were based on his feedback.

Changes since v11:
- Rebased to 3.18-rc1, dropping patch "vfs: Add copy_to_iter(), copy_from_iter() and iov_iter_zero()" as it was merged through Al's tree.
- Added cc to [email protected] on patch 1
- Fixed comment style in brd.c (Mathieu)
- Make more functions in fs.h common with and without CONFIG_FS_DAX set
- Improve type-checking with !CONFIG_FS_DAX
- Simplify check for holes in dax_io()
- Harden the loop in dax_clear_blocks()
- Add missing check against truncate of a page covering a hole
- Fix the page-fault handler to work for block devices too
- Change a few more places that mentioned 'XIP' into 'DAX'
- Update DAX documentation in a couple of places

Matthew Wilcox (19):
axonram: Fix bug in direct_access
block: Change direct_access calling convention
mm: Fix XIP fault vs truncate race
mm: Allow page fault handlers to perform the COW vfs,ext2: Introduce IS_DAX(inode)
dax,ext2: Replace XIP read and write with DAX I/O dax,ext2: Replace ext2_clear_xip_target with dax_clear_blocks dax,ext2: Replace the XIP page fault handler with the DAX page fault
handler
dax,ext2: Replace xip_truncate_page with dax_truncate_page
dax: Replace XIP documentation with DAX documentation
vfs: Remove get_xip_mem
ext2: Remove ext2_xip_verify_sb()
ext2: Remove ext2_use_xip
ext2: Remove xip.c and xip.h
vfs,ext2: Remove CONFIG_EXT2_FS_XIP and rename CONFIG_FS_XIP to
CONFIG_FS_DAX
ext2: Remove ext2_aops_xip
ext2: Get rid of most mentions of XIP in ext2
dax: Add dax_zero_page_range
brd: Rename XIP to DAX

Ross Zwisler (1):
ext4: Add DAX functionality

 Documentation/filesystems/00-INDEX |   5 +-
 Documentation/filesystems/Locking  |   3 -
 Documentation/filesystems/dax.txt  |  91 +++++++
 Documentation/filesystems/ext2.txt |   5 +-
 Documentation/filesystems/ext4.txt |   4 +
 Documentation/filesystems/vfs.txt  |   7 -
 Documentation/filesystems/xip.txt  |  68 -----
 MAINTAINERS                        |   6 +
 arch/powerpc/sysdev/axonram.c      |  19 +-
 drivers/block/Kconfig              |  13 +-
 drivers/block/brd.c                |  28 +-
 drivers/s390/block/dcssblk.c       |  21 +-
 fs/Kconfig                         |  21 +-
 fs/Makefile                        |   1 +
 fs/block_dev.c                     |  40 +++
 fs/dax.c                           | 530 +++++++++++++++++++++++++++++++++++++
 fs/exofs/inode.c                   |   1 -
 fs/ext2/Kconfig                    |  11 -
 fs/ext2/Makefile                   |   1 -
 fs/ext2/ext2.h                     |  10 +-
 fs/ext2/file.c                     |  45 +++-
 fs/ext2/inode.c                    |  38 +--
 fs/ext2/namei.c                    |  13 +-
 fs/ext2/super.c                    |  53 ++--
 fs/ext2/xip.c                      |  91 -------
 fs/ext2/xip.h                      |  26 --
 fs/ext4/ext4.h                     |   6 +
 fs/ext4/file.c                     |  50 +++-
 fs/ext4/indirect.c                 |  18 +-
 fs/ext4/inode.c                    |  89 +++++--
 fs/ext4/namei.c                    |  10 +-
 fs/ext4/super.c                    |  39 ++-
 fs/open.c                          |   5 +-
 include/linux/blkdev.h             |   6 +-
 include/linux/fs.h                 |  34 +--
 include/linux/mm.h                 |   1 +
 include/linux/rmap.h               |   2 +-
 mm/Makefile                        |   1 -
 mm/fadvise.c                       |   6 +-
 mm/filemap.c                       |  25 +-
 mm/filemap_xip.c                   | 483 ---------------------------------
 mm/madvise.c                       |   2 +-
 mm/memory.c                        |  33 ++-
 scripts/diffconfig                 |   1 -
 44 files changed, 1069 insertions(+), 893 deletions(-)
 create mode 100644 Documentation/filesystems/dax.txt
 delete mode 100644 Documentation/filesystems/xip.txt
 create mode 100644 fs/dax.c
 delete mode 100644 fs/ext2/xip.c
 delete mode 100644 fs/ext2/xip.h
 delete mode 100644 mm/filemap_xip.c
Signature · 7 lines
2.1.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>