Direct Access
Direct Access is a Linux mechanism that lets suitable memory-like storage serve file data without an intervening page-cache copy.
For memory-like block devices, page-cache pages would be unnecessary copies of the storage, so DAX performs reads and writes directly against the device and maps it into userspace for file mappings. It does not by itself flush CPU caches or establish application crash consistency. [1]
The kernel documentation lists 5 filesystems with DAX support, namely ext2, ext4, xfs, virtiofs and erofs, and requires a filesystem block size equal to the kernel PAGE_SIZE. On ext4 and xfs the persistent FS_XFLAG_DAX preference and the active S_DAX state are distinct. The options dax=inode, the default, dax=never and dax=always decide how the preference applies, and statx reports the active state through STATX_ATTR_DAX. [1]
MAP_SYNC, available since Linux 4.15, adds a mapping guarantee used with appropriate CPU instructions rather than making every store automatically durable. [2]
Namespace mode also matters: ndctl sector mode disables DAX while a Block Translation Table provides atomic sector updates. That protection is not added beneath a DAX mapping, and sector atomicity is not an arbitrary multi-sector transaction guarantee. [4]
Namespace reconfiguration is not a data-preserving mode switch. The ndctl --reconfig operation destroys and recreates the namespace. Transfer existing contents through backup and restore; old bytes that remain visible do not establish preservation. [4]
Relations
- related
- Persistent memory, Byte-addressable storage, MAP_SYNC, Persistence domain, NVDIMM-N, Device DAX, NOVA file system, SplitFS, Aerie, Kuco, NOVA-Fortis, MadFS, WineFS
Advantages
- Avoids holding a second copy of file data in DRAM, so mapped access reaches the storage media directly. [1]
Limitations
- Setting FS_XFLAG_DAX on an existing file does not immediately change its S_DAX state, so the effective mode must be checked rather than assumed. [1]
- Without struct page support, memory mapped from a DAX file fails get_user_pages, and RDMA, sendfile and splice on it do not work. [1]
Citations
- Linux kernel documentation. Direct Access for files: motivation, usage, S_DAX state and struct page limits.
- Linux man-pages. mmap(2), MAP_SYNC and MAP_SHARED_VALIDATE.
- ndctl-create-namespace(1): sector, fsdax and devdax modes; BTT disables DAX.
Further reading
Sources & caveats
- dax-docs is the Linux kernel documentation page Direct Access for files, re-read on 2026-10-22 in the motivation, usage and implementation sections.
- The 5 filesystems, the PAGE_SIZE block-size rule, the dax= options and the struct page restriction come from dax-docs.
- mmap-docs is the Linux man-pages mmap(2) page, re-read on 2026-10-22, and is the source of Linux 4.15.
- ndctl-mode documents the sector/BTT incompatibility with DAX; it does not imply that the backup-energy source changes the namespace access mode.