]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: add a config file for x86_64 pmem filesystems
authorDarrick J. Wong <djwong@kernel.org>
Thu, 16 Dec 2021 00:34:58 +0000 (16:34 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 16 Dec 2021 01:35:12 +0000 (17:35 -0800)
We have a handful of users who continually ping the maintainer with
questions about why pmem and dax don't work quite the way they want
(which is to say 2MB extents and PMD mappings) because they copy-pasted
some garbage from Google that's wrong.  Encode the correct defaults into
a mkfs config file and ship that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
mkfs/Makefile
mkfs/dax_x86_64.conf [new file with mode: 0644]

index 04d17fdb36ab60f535a641338729d50686bcb7ea..12f046d7ba278641f89ff11c429f6de093908bf4 100644 (file)
@@ -9,7 +9,7 @@ LTCOMMAND = mkfs.xfs
 
 HFILES =
 CFILES = proto.c xfs_mkfs.c
-CFGFILES = lts_4.19.conf lts_5.10.conf lts_5.15.conf
+CFGFILES = dax_x86_64.conf lts_4.19.conf lts_5.10.conf lts_5.15.conf
 
 LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBBLKID) \
        $(LIBUUID) $(LIBINIH) $(LIBURCU)
diff --git a/mkfs/dax_x86_64.conf b/mkfs/dax_x86_64.conf
new file mode 100644 (file)
index 0000000..bc3f3c9
--- /dev/null
@@ -0,0 +1,19 @@
+# mkfs.xfs configuration file for persistent memory on x86_64.
+# Block size must match page size (4K) and we require V5 for the DAX inode
+# flag.  Set extent size hints and stripe units to encourage the filesystem to
+# allocate PMD sized (2MB) blocks.
+
+[block]
+size=4096
+
+[metadata]
+crc=1
+
+[data]
+sunit=4096
+swidth=4096
+extszinherit=512
+daxinherit=1
+
+[realtime]
+extsize=2097152