ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure as
- Valid Fields, Manufacturing Location, and Manufacturing Date
are added from reserved range. No change in the structure size.
- IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
format). The spec clarifies that they need to be represented
as arrays of bytes as well.
Patch 1 changes the NFIT driver to comply with ACPI 6.1.
Patch 2 adds a new sysfs file "id" to show NVDIMM ID defined in ACPI 6.1.
The patch-set applies on linux-pm.git acpica.
- Need to coordinate with ACPICA update (Bob Moore, Dan Williams)
- Integrate with ACPICA changes in struct acpi_nfit_control_region.
- Remove 'mfg_location' and 'mfg_date'. (Dan Williams)
- Rename 'unique_id' to 'id' and make this change as a separate patch.
Toshi Kani (3):
1/2 acpi/nfit: Update nfit driver to comply with ACPI 6.1
2/3 acpi/nfit: Add sysfs "id" for NVDIMM ID
drivers/acpi/nfit.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
The last patch is what started the series: XFS currently uses the
direct I/O locking strategy for DAX because DAX was overloaded onto
the direct I/O path. For XFS this means that we only take a shared
inode lock instead of the normal exclusive one for writes IFF they
are properly aligned. While this is fine for O_DIRECT which requires
explicit opt-in from the application it's not fine for DAX where we'll
suddenly lose expected and required synchronization of the file system
happens to use DAX undeneath.
Patches 1-7 just untangle the code so that we can deal with DAX on
it's own easily.
DAX PMDs have been disabled since Jan Kara introduced DAX radix tree based
locking. This series allows DAX PMDs to participate in the DAX radix tree
based locking scheme so that they can be re-enabled.
Changes since v1:
- PMD entry locking is now done based on the starting offset of the PMD
entry, rather than on the radix tree slot which was unreliable. (Jan)
- Fixed the one issue I could find with hole punch. As far as I can tell
hole punch now works correctly for both PMD and PTE DAX entries, 4k zero
pages and huge zero pages.
- Fixed the way that ext2 returns the size of holes in ext2_get_block().
- Made the 'wait_table' global variable static in respnse to a sparse
- Fixed some more inconsitent usage between the names 'ret' and 'entry'
for radix tree entry variables.
Ross Zwisler (9):
ext4: allow DAX writeback for hole punch
ext2: tell DAX the size of allocation holes
ext4: tell DAX the size of allocation holes
dax: remove buffer_size_valid()
dax: make 'wait_table' global variable static
dax: consistent variable naming for DAX entries
dax: coordinate locking for offsets in PMD range
dax: re-enable DAX PMD support
dax: remove "depends on BROKEN" from FS_DAX_PMD
fs/Kconfig | 1 -
fs/dax.c | 297 +++++++++++++++++++++++++++++-----------------------
fs/ext2/inode.c | 3 +
fs/ext4/inode.c | 7 +-
include/linux/dax.h | 29 ++++-
mm/filemap.c | 6 +-
6 files changed, 201 insertions(+), 142 deletions(-)
When CONFIG_FS_DAX_PMD is set, DAX supports mmap() using pmd page
size. This feature relies on both mmap virtual address and FS
block (i.e. physical address) to be aligned by the pmd page size.
Users can use mkfs options to specify FS to align block allocations.
However, aligning mmap address requires code changes to existing
applications for providing a pmd-aligned address to mmap().
For instance, fio with "ioengine=mmap" performs I/Os with mmap() .
It calls mmap() with a NULL address, which needs to be changed to
provide a pmd-aligned address for testing with DAX pmd mappings.
Changing all applications that call mmap() with NULL is undesirable.
This patch-set extends filesystems to align an mmap address for
a DAX file so that unmodified applications can use DAX pmd mappings.
- Rebased to 4.8.0-rc4, and drop blk as BLK_DEV_DAX was removed.
- Use loff_t for offset and cast before shift (Jan Kara)
- Remove redundant paranthesis (Jan Kara)
- Allow integration with huge page cache support (Matthew Wilcox)
- Prepare for PUD mapping support (Mike Kravetz, Matthew Wilcox)
- Check overflow condition to offset + length. (Matthew Wilcox)
- Remove indent by using gotos. (Matthew Wilcox)
- Define dax_get_unmapped_area to NULL when CONFIG_FS_DAX is unset.
- Squash all filesystem patches together. (Matthew Wilcox)
- Change filesystems to provide their get_unmapped_area().
- Add more description about the benefit. (Matthew Wilcox)
Toshi Kani (2):
1/2 thp, dax: add thp_get_unmapped_area for pmd mappings
2/2 ext2/4, xfs, blk: call thp_get_unmapped_area() for pmd mappings
fs/ext2/file.c | 1 +
fs/ext4/file.c | 1 +
fs/xfs/xfs_file.c | 1 +
include/linux/huge_mm.h | 7 +++++++
mm/huge_memory.c | 43 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 53 insertions(+)
Recently, Redhat reported that nvml test suite failed on QEMU/KVM,
more detailed info please refer to:
The reason for this bug is that the memory region created by mmap()
on the dax-based file was gone so that the region can not be found
in /proc/self/smaps during the runtime.
This is a simple way to trigger this issue:
mount -o dax /dev/pmem0 /mnt/pmem/
then 'vim' is crashed due to segment fault.
This bug can be reproduced on your tree, the top commit is
10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel
configure file is attached.
Your thought or comment is highly appreciated.
ACPI 6.1 added an "NFIT Health Event Notification" for nvdimm devices.
When this fires, system software is expected to issue a DSM to retrieve
the latest health values. For the NFIT driver this notification
arrives as an event on the sysfs 'flags' attribute for an nfit/nvdimm
device. The 'flags' attribute reflects the "NVDIMM State Flags" of the
"126.96.36.199 NVDIMM Region Mapping Structure", and when read indicates if
the platform supports sending health events.
Dan Williams (3):
tools/testing/nvdimm: unit test for acpi_nfit_notify()
acpi, nfit: add dimm device notification support
tools/testing/nvdimm: unit test for acpi_nvdimm_notify()
drivers/acpi/nfit/core.c | 112 ++++++++++++++++++++++++++++++++-----
drivers/acpi/nfit/nfit.h | 7 ++
drivers/nvdimm/dimm_devs.c | 6 ++
include/linux/libnvdimm.h | 1
tools/testing/nvdimm/Kbuild | 1
tools/testing/nvdimm/test/iomap.c | 17 ++++++
tools/testing/nvdimm/test/nfit.c | 64 +++++++++++++++++++--
7 files changed, 188 insertions(+), 20 deletions(-)