[GIT PULL] dax-misc for 4.7
by Vishal Verma
Hi Linus, please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/dax-misc-for-4.7
...to receive the dax error handling topic branch for 4.7.
Most of these changes have been stable since before the merge window, but getting
the different trees/patchsets integrated into this topic branch took a couple more
days. These have also been in linux-next for almost a week, and have received a
positive 0day notification for a successful build for 118 configs.
Note that this branch depends on Ted's ext4 dev branch, and should be merged after
that. The pull request is based on this branch so that the shortlog and diffstat
look correct.
The merge with libnvdimm-for-next will cause a conflict, and I have a branch
with the expected resolution at:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-for-4.7-merge
Notably, the automatic merge ends up with two copies of a function in fs/block_dev.c
blkdev_dax_capable(), and bdev_dax_capable(), where blkdev_dax_capable is unused, and
should be removed [1].
[1]: http://www.spinics.net/lists/kernel/msg2258671.html
The following changes since commit 12735f881952c32b31bc4e433768f18489f79ec9:
ext4: pre-zero allocated blocks for DAX IO (2016-05-13 00:51:15 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/dax-misc-for-4.7
for you to fetch changes up to 40543f62cbdce42633e3fe10923099feee272e1f:
dax: fix a comment in dax_zero_page_range and dax_truncate_page (2016-05-18 12:16:58 -0600)
----------------------------------------------------------------
DAX error handling for 4.7
- Until now, dax has been disabled if media errors were found on
any device. This enables the use of DAX in the presence of these
errors by making all sector-aligned zeroing go through the driver.
- The driver (already) has the ability to clear errors on writes that
are sent through the block layer using 'DSMs' defined in ACPI 6.1.
Other misc changes:
- When mounting DAX filesystems, check to make sure the partition
is page aligned. This is a requirement for DAX, and previously, we
allowed such unaligned mounts to succeed, but subsequent reads/writes
would fail.
- Misc/cleanup fixes from Jan that remove unused code from DAX related to
zeroing, writeback, and some size checks.
----------------------------------------------------------------
Christoph Hellwig (1):
dax: export a low-level __dax_zero_page_range helper
Dan Williams (2):
dax: fallback from pmd to pte on error
dax: enable dax in the presence of known media errors (badblocks)
Jan Kara (7):
dax: Remove complete_unwritten argument
ext2: Fix block zeroing in ext2_get_blocks() for DAX
ext2: Avoid DAX zeroing to corrupt data
dax: Remove dead zeroing code from fault handlers
dax: Remove zeroing from dax_io()
dax: Remove pointless writeback from dax_do_io()
dax: Remove redundant inode size checks
Matthew Wilcox (1):
dax: use sb_issue_zerout instead of calling dax_clear_sectors
NeilBrown (1):
DAX: move RADIX_DAX_ definitions to dax.c
Toshi Kani (6):
block: Add vfs_msg() interface
block: Add bdev_dax_supported() for dax mount checks
ext4: Add alignment check for DAX mount
ext2: Add alignment check for DAX mount
xfs: Add alignment check for DAX mount
block: Update blkdev_dax_capable() for consistency
Vishal Verma (2):
dax: for truncate/hole-punch, do zeroing through the driver if possible
dax: fix a comment in dax_zero_page_range and dax_truncate_page
Documentation/filesystems/dax.txt | 32 +++++
arch/powerpc/sysdev/axonram.c | 2 +-
block/ioctl.c | 30 -----
drivers/block/brd.c | 2 +-
drivers/nvdimm/pmem.c | 10 +-
drivers/s390/block/dcssblk.c | 4 +-
fs/block_dev.c | 91 ++++++++++++-
fs/dax.c | 266 +++++++++++---------------------------
fs/ext2/file.c | 4 +-
fs/ext2/inode.c | 12 +-
fs/ext2/super.c | 11 +-
fs/ext4/file.c | 4 +-
fs/ext4/super.c | 11 +-
fs/xfs/xfs_bmap_util.c | 15 +--
fs/xfs/xfs_file.c | 7 +-
fs/xfs/xfs_super.c | 12 +-
include/linux/blkdev.h | 15 ++-
include/linux/dax.h | 25 ++--
include/linux/fs.h | 9 --
include/linux/radix-tree.h | 9 --
20 files changed, 257 insertions(+), 314 deletions(-)
6 years, 1 month
[ndctl PATCH] ndctl: spec updates for bash-completion + daxctl
by Dan Williams
Install the new bash completion script and define new rpms for
libdaxctl.
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
Makefile.am | 4 ++++
ndctl.spec.in | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index fee893ce3003..ce1032e3381d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,14 +17,18 @@ noinst_SCRIPTS = rhel/ndctl.spec sles/ndctl.spec
CLEANFILES += $(noinst_SCRIPTS)
do_rhel_subst = sed -e 's,VERSION,$(VERSION),g' \
+ -e 's,DAX_DNAME,daxctl-devel,g' \
-e 's,DNAME,ndctl-devel,g' \
-e '/^%defattr.*/d' \
+ -e 's,DAX_LNAME,daxctl-libs,g' \
-e 's,LNAME,ndctl-libs,g'
do_sles_subst = sed -e 's,VERSION,$(VERSION),g' \
+ -e 's,DAX_DNAME,libdaxctl-devel,g' \
-e 's,DNAME,libndctl-devel,g' \
-e 's,%license,%doc,g' \
-e 's,\(^License:.*GPL\)v2,\1-2.0,g' \
+ -e "s,DAX_LNAME,libdaxctl$$(($(LIBDAXCTL_CURRENT) - $(LIBDAXCTL_AGE))),g" \
-e "s,LNAME,libndctl$$(($(LIBNDCTL_CURRENT) - $(LIBNDCTL_AGE))),g"
rhel/ndctl.spec: ndctl.spec.in Makefile.am version.m4
diff --git a/ndctl.spec.in b/ndctl.spec.in
index b8129e533e13..4ed5e726ac75 100644
--- a/ndctl.spec.in
+++ b/ndctl.spec.in
@@ -17,6 +17,7 @@ BuildRequires: pkgconfig(libkmod)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(json-c)
+BuildRequires: pkgconfig(bash-completion)
%description
Utility library for managing the "libnvdimm" subsystem. The "libnvdimm"
@@ -35,15 +36,40 @@ Requires: LNAME%{?_isa} = %{version}-%{release}
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
+%package -n DAX_DNAME
+Summary: Development files for libdaxctl
+License: LGPLv2
+Group: Development/Libraries
+Requires: LNAME%{?_isa} = %{version}-%{release}
+
+%description -n DAX_DNAME
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}, a library for enumerating
+"Device DAX" devices. Device DAX is a facility for establishing DAX
+mappings of performance / feature-differentiated memory.
+
%package -n LNAME
Summary: Management library for "libnvdimm" subsystem devices (Non-volatile Memory)
License: LGPLv2
Group: System Environment/Libraries
+Requires: DAX_LNAME%{?_isa} = %{version}-%{release}
+
%description -n LNAME
Libraries for %{name}.
+%package -n DAX_LNAME
+Summary: Management library for "Device DAX" devices
+License: LGPLv2
+Group: System Environment/Libraries
+
+%description -n DAX_LNAME
+Device DAX is a facility for establishing DAX mappings of performance /
+feature-differentiated memory. DAX_LNAME provides an enumeration /
+control api for these devices.
+
+
%prep
%setup -q ndctl-%{version}
@@ -64,11 +90,18 @@ make check
%postun -n LNAME -p /sbin/ldconfig
+%post -n DAX_LNAME -p /sbin/ldconfig
+
+%postun -n DAX_LNAME -p /sbin/ldconfig
+
+%define bashcompdir %(pkg-config --variable=completionsdir bash-completion)
+
%files
%defattr(-,root,root)
%license licenses/GPLv2 licenses/BSD-MIT licenses/CC0
%{_bindir}/ndctl
%{_mandir}/man1/*
+%{bashcompdir}/ndctl
%files -n LNAME
%defattr(-,root,root)
@@ -76,6 +109,12 @@ make check
%license COPYING licenses/BSD-MIT licenses/CC0
%{_libdir}/libndctl.so.*
+%files -n DAX_LNAME
+%defattr(-,root,root)
+%doc README.md
+%license COPYING licenses/BSD-MIT licenses/CC0
+%{_libdir}/libdaxctl.so.*
+
%files -n DNAME
%defattr(-,root,root)
%license COPYING
@@ -83,6 +122,14 @@ make check
%{_libdir}/libndctl.so
%{_libdir}/pkgconfig/libndctl.pc
+%files -n DAX_DNAME
+%defattr(-,root,root)
+%license COPYING
+%{_includedir}/daxctl/
+%{_libdir}/libdaxctl.so
+%{_libdir}/pkgconfig/libdaxctl.pc
+
+
%changelog
* Mon Apr 04 2016 Dan Williams <dan.j.williams(a)intel.com> - 52-1
- Initial rpm submission to Fedora
6 years, 1 month
[ndctl PATCH v2 0/2] bash completion for ndctl
by Vishal Verma
Changes in v2:
- Fix '-' not appearing after --refconfig (Dan)
- Complete --refconfig with namespaces (Dan)
- For all completions of regions and dimms, if a --bus= has been
provided, use it to filter and show only the regions/dimms on
that bus
- Similarly, for all completions of namespaces, filter using both,
prior --bus= or --region= options.
- Distinguish between idle and active namespaces and regions, and
complete with one or the other set depending on the command
(e.g. enable-* will list all regions/namespaces including idle).
- For options that don't need an additional parameter, add a space
after a full completion (i.e. any option that doesn't end in
a '=').
- In patch 1 (segfault fix), fix a typo in the commit log and add
Reveiwed-by tags.
Vishal Verma (2):
ndctl: fix a segfault in parse-options.c
ndctl: add bash completion
Makefile.am | 5 +
configure.ac | 17 +++
contrib/ndctl | 330 +++++++++++++++++++++++++++++++++++++++++++++++++++
util/parse-options.c | 5 +-
4 files changed, 355 insertions(+), 2 deletions(-)
create mode 100755 contrib/ndctl
--
2.5.5
6 years, 1 month
[ndctl PATCH 0/2] bash completion for ndctl
by Vishal Verma
ndctl dearly needed some bash completion goodness, so I decided to fix that.
The following kinds of completion are now supported:
$ ndctl
create-namespace disable-region help version
destroy-namespace enable-namespace list zero-labels
disable-namespace enable-region read-labels
$ ndctl create-namespace --
--bus= --map= --name= --region= --size= --uuid=
--force --mode= --reconfig --sector-size= --type= --verbose
$ ndctl create-namespace --region=region
region0 region1 region2 region3 region4 region5 region6 region7 region8
$ ndctl create-namespace --region=region^C
$ ndctl disable-namespace
all namespace6.0 namespace7.0 namespace8.0
$ ndctl read-labels
all nmem0 nmem1 nmem2 nmem3 nmem4
$ ndctl read-labels ^C
$ ndctl --
--help --list-cmds --version
$ ndctl list --namespaces --bus
--bus= --buses
$ ndctl list --namespaces --bus=nfit_test.
nfit_test.0 nfit_test.1
$ ndctl list --namespaces --bus=nfit_test.
git/perf which this is based on has support for ZSH, so we *probably*
automatically get it, but I haven't tested it.
Go test it out!
Vishal Verma (2):
ndctl: fix a segfault in parse-options.c
ndctl: add bash completion
Makefile.am | 5 +
configure.ac | 17 +++
contrib/ndctl | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++
util/parse-options.c | 5 +-
4 files changed, 313 insertions(+), 2 deletions(-)
create mode 100755 contrib/ndctl
--
2.5.5
6 years, 1 month
[PATCH 0/2] libnvdimm, dax: autodetect fixes
by Dan Williams
Now that the base device-DAX implementation is settling I am circling
back to further flesh out the ndctl unit tests. These 2 fixes fell out
as a result.
---
Dan Williams (2):
libnvdimm, dax: autodetect support
libnvdimm, dax: fix alignment validation
drivers/nvdimm/dax_devs.c | 35 +++++++++++++++++++++++++++++++++++
drivers/nvdimm/nd.h | 11 +++++++++--
drivers/nvdimm/pfn.h | 1 +
drivers/nvdimm/pfn_devs.c | 20 +++++++++++++-------
drivers/nvdimm/pmem.c | 3 ++-
5 files changed, 60 insertions(+), 10 deletions(-)
6 years, 1 month
[GIT PULL] libnvdimm for 4.7
by Williams, Dan J
Hi Linus, please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-for-4.7
...to receive the device driver related nvdimm topic branches for 4.7.
The bulk of this update was stabilized before the merge window and
appeared in -next. The "device dax" implementation was revised this
week in response to review feedback, and to address failures detected
by the recently expanded ndctl unit test suite.
Not included in this pull request are two dax topic branches (dax error
handling, and dax radix-tree locking). These topics were deferred to
get a few more days of -next integration testing, and to coordinate a
branch baseline with Ted and the ext4 tree. Vishal and Ross will send
the error handling and locking topics respectively in the next few
days.
This branch has received a positive build result from the kbuild robot
across 226 configs.
The following changes since commit 1b8d2afde54fade94339f573c4e05644f9ae9866:
libnvdimm, pfn: fix ARCH=alpha allmodconfig build failure (2016-05-06 10:20:10 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-for-4.7
for you to fetch changes up to 36092ee8ba695fce023b2118ececa6c2a56b1331:
Merge branch 'for-4.7/dax' into libnvdimm-for-next (2016-05-21 12:33:04 -0700)
----------------------------------------------------------------
libnvdimm for 4.7
1/ Device DAX for persistent memory:
Device DAX is the device-centric analogue of Filesystem DAX
(CONFIG_FS_DAX). It allows memory ranges to be allocated and mapped
without need of an intervening file system. Device DAX is strict,
precise and predictable. Specifically this interface:
a) Guarantees fault granularity with respect to a given page size
(pte, pmd, or pud) set at configuration time.
b) Enforces deterministic behavior by being strict about what fault
scenarios are supported.
Persistent memory is the first target, but the mechanism is also
targeted for exclusive allocations of performance/feature differentiated
memory ranges.
2/ Support for the HPE DSM (device specific method) command formats.
This enables management of these first generation devices until a
unified DSM specification materializes.
3/ Further ACPI 6.1 compliance with support for the common dimm
identifier format.
4/ Various fixes and cleanups across the subsystem.
----------------------------------------------------------------
Dan Williams (40):
libnvdimm, nfit: report multiple interface codes per-dimm
libnvdimm, test: add mock SMART data payload
libnvdimm, pmem: kill pmem->ndns
libnvdimm, pfn, convert nd_pfn_probe() to devm
libnvdimm, btt, convert nd_btt_probe() to devm
libnvdimm, btt: add btt startup debug
libnvdimm, blk: use devm_add_action to release bdev resources
libnvdimm, blk: use ->queuedata for driver private data
libnvdimm, pmem: use ->queuedata for driver private data
libnvdimm, blk: quiet i/o error reporting
libnvdimm, blk: move i/o infrastructure to nd_namespace_blk
libnvdimm, pmem: use devm_add_action to release bdev resources
libnvdimm, pmem: clean up resource print / request
libnvdimm, pmem, pfn: make pmem_rw_bytes generic and refactor pfn setup
libnvdimm, pmem, pfn: move pfn setup to the core
libnvdimm, pmem: kill ->pmem_queue and ->pmem_disk
libnvdimm: cleanup nvdimm_namespace_common_probe(), kill 'host'
nfit, libnvdimm: clarify "commands" vs "_DSMs"
nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism
nfit: fix format interface code byte order per ACPI6.1
nfit: export subsystem ids as attributes
nfit: disable vendor specific commands
tools/testing/nvdimm: ND_CMD_CALL support
nfit: add sysfs dimm 'family' and 'dsm_mask' attributes
libnvdimm, dax: introduce device-dax infrastructure
libnvdimm, dax: reserve space to store labels for device-dax
libnvdimm, dax: record the specified alignment of a dax-device instance
libnvdimm: stop requiring a driver ->remove() method
Merge branch 'for-4.7/dax' into libnvdimm-for-next
Merge branch 'for-4.7/libnvdimm' into libnvdimm-for-next
Merge branch 'for-4.7/dsm' into libnvdimm-for-next
Merge branch 'for-4.7/acpi6.1' into libnvdimm-for-next
/dev/dax, pmem: direct access to persistent memory
/dev/dax, core: file operations and dax-mmap
Revert "block: enable dax for raw block devices"
libnvdimm: release ida resources
libnvdimm, dax: autodetect support
libnvdimm, dax: fix alignment validation
libnvdimm, dax: fix deletion
Merge branch 'for-4.7/dax' into libnvdimm-for-next
Jerry Hoemann (2):
acpi: widen acpi_evaluate_dsm() revision and function-index arguments
libnvdimm: increase max envelope size for ioctl
Lee, Chun-Yi (1):
libnvdimm, nfit: Use ACPI_SIG_NFIT instead of hard coded string
Toshi Kani (2):
acpi/nfit: Update nfit driver to comply with ACPI 6.1
acpi/nfit: Add sysfs "id" for NVDIMM ID
block/ioctl.c | 32 ---
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/acpi/nfit.c | 282 ++++++++++++++++++++++---
drivers/acpi/nfit.h | 31 ++-
drivers/acpi/utils.c | 4 +-
drivers/dax/Kconfig | 26 +++
drivers/dax/Makefile | 4 +
drivers/dax/dax.c | 575 ++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/dax/dax.h | 24 +++
drivers/dax/pmem.c | 158 ++++++++++++++
drivers/nvdimm/Kconfig | 13 ++
drivers/nvdimm/Makefile | 1 +
drivers/nvdimm/blk.c | 208 +++++++++---------
drivers/nvdimm/btt.c | 26 ++-
drivers/nvdimm/btt_devs.c | 24 +--
drivers/nvdimm/bus.c | 63 +++++-
drivers/nvdimm/claim.c | 86 +++++++-
drivers/nvdimm/core.c | 5 +-
drivers/nvdimm/dax_devs.c | 134 ++++++++++++
drivers/nvdimm/dimm_devs.c | 23 +-
drivers/nvdimm/namespace_devs.c | 38 ++--
drivers/nvdimm/nd-core.h | 6 +-
drivers/nvdimm/nd.h | 83 +++++++-
drivers/nvdimm/pfn.h | 5 +-
drivers/nvdimm/pfn_devs.c | 315 ++++++++++++++++++++++-----
drivers/nvdimm/pmem.c | 493 ++++++++++---------------------------------
drivers/nvdimm/region.c | 2 +
drivers/nvdimm/region_devs.c | 34 +++
fs/block_dev.c | 96 +++------
include/acpi/acpi_bus.h | 6 +-
include/linux/fs.h | 8 -
include/linux/libnvdimm.h | 7 +-
include/linux/nd.h | 11 +-
include/uapi/linux/fs.h | 1 -
include/uapi/linux/ndctl.h | 80 ++++++-
mm/huge_memory.c | 1 +
mm/hugetlb.c | 1 +
tools/testing/nvdimm/Kbuild | 11 +
tools/testing/nvdimm/config_check.c | 2 +
tools/testing/nvdimm/test/iomap.c | 27 ++-
tools/testing/nvdimm/test/nfit.c | 90 ++++++--
42 files changed, 2252 insertions(+), 787 deletions(-)
6 years, 1 month
[PATCH] libnvdimm, dax: fix deletion
by Dan Williams
The ndctl unit tests discovered that the dax enabling omitted updates to
nd_detach_and_reset(). This routine clears device the configuration
when the namespace is detached. Without this clearing userspace may
assume that the device is in the process of being configured by another
agent in the system.
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/nvdimm/claim.c | 23 +++++++++++++++++++++--
drivers/nvdimm/nd-core.h | 1 +
drivers/nvdimm/pfn_devs.c | 19 -------------------
3 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 5f53db59a058..8b2e3c4fb0ad 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -93,6 +93,25 @@ static bool is_idle(struct device *dev, struct nd_namespace_common *ndns)
return true;
}
+struct nd_pfn *to_nd_pfn_safe(struct device *dev)
+{
+ /*
+ * pfn device attributes are re-used by dax device instances, so we
+ * need to be careful to correct device-to-nd_pfn conversion.
+ */
+ if (is_nd_pfn(dev))
+ return to_nd_pfn(dev);
+
+ if (is_nd_dax(dev)) {
+ struct nd_dax *nd_dax = to_nd_dax(dev);
+
+ return &nd_dax->nd_pfn;
+ }
+
+ WARN_ON(1);
+ return NULL;
+}
+
static void nd_detach_and_reset(struct device *dev,
struct nd_namespace_common **_ndns)
{
@@ -106,8 +125,8 @@ static void nd_detach_and_reset(struct device *dev,
nd_btt->lbasize = 0;
kfree(nd_btt->uuid);
nd_btt->uuid = NULL;
- } else if (is_nd_pfn(dev)) {
- struct nd_pfn *nd_pfn = to_nd_pfn(dev);
+ } else if (is_nd_pfn(dev) || is_nd_dax(dev)) {
+ struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev);
kfree(nd_pfn->uuid);
nd_pfn->uuid = NULL;
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h
index 4136c1a82539..6c42eda025f9 100644
--- a/drivers/nvdimm/nd-core.h
+++ b/drivers/nvdimm/nd-core.h
@@ -94,4 +94,5 @@ bool __nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
ssize_t nd_namespace_store(struct device *dev,
struct nd_namespace_common **_ndns, const char *buf,
size_t len);
+struct nd_pfn *to_nd_pfn_safe(struct device *dev);
#endif /* __ND_CORE_H__ */
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 04f71d6d304d..436191c47077 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -54,25 +54,6 @@ struct nd_pfn *to_nd_pfn(struct device *dev)
}
EXPORT_SYMBOL(to_nd_pfn);
-static struct nd_pfn *to_nd_pfn_safe(struct device *dev)
-{
- /*
- * pfn device attributes are re-used by dax device instances, so we
- * need to be careful to correct device-to-nd_pfn conversion.
- */
- if (is_nd_pfn(dev))
- return to_nd_pfn(dev);
-
- if (is_nd_dax(dev)) {
- struct nd_dax *nd_dax = to_nd_dax(dev);
-
- return &nd_dax->nd_pfn;
- }
-
- WARN_ON(1);
- return NULL;
-}
-
static ssize_t mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
6 years, 1 month
[ndctl PATCH 0/5] Device DAX support
by Dan Williams
Extend libndctl with a libdaxctl helper library to enumerate the devices
that appear underneath a libnvdimm namespace in "dax" mode. libdaxctl
is meant to be independent from libndctl as device-dax instances may
arise from other memory ranges besides persistent memory. It is a
generic enumeration facility for performance / featured differentiated
memory ranges when the kernel arranges for them to be exposed as a
devices.
---
Dan Williams (5):
util: centralize logging
util: centralize sysfs helpers
test: fix 'pfn alignment too big' checks
daxctl: initial boilerplate
daxctl: enumeration api and unit test for "Device DAX"
Makefile.am | 2
Makefile.am.in | 3
configure.ac | 1
daxctl/Makefile.am | 28 ++
daxctl/lib/libdaxctl-private.h | 40 +++
daxctl/lib/libdaxctl.c | 353 ++++++++++++++++++++++++++++
daxctl/lib/libdaxctl.pc.in | 11 +
daxctl/lib/libdaxctl.sym | 32 +++
daxctl/libdaxctl.h | 64 +++++
ndctl/Makefile.am | 21 +-
ndctl/lib/libndctl-private.h | 65 ++---
ndctl/lib/libndctl-smart.c | 1
ndctl/lib/libndctl.c | 219 ++++--------------
ndctl/lib/libndctl.sym | 2
ndctl/libndctl.h.in | 3
test/Makefile.am | 4
test/libndctl.c | 500 ++++++++++++++++++++++++++++++++++------
util/log.c | 65 +++++
util/log.h | 69 ++++++
util/sysfs.c | 128 ++++++++++
util/sysfs.h | 40 +++
21 files changed, 1350 insertions(+), 301 deletions(-)
create mode 100644 daxctl/Makefile.am
create mode 100644 daxctl/lib/libdaxctl-private.h
create mode 100644 daxctl/lib/libdaxctl.c
create mode 100644 daxctl/lib/libdaxctl.pc.in
create mode 100644 daxctl/lib/libdaxctl.sym
create mode 100644 daxctl/libdaxctl.h
create mode 100644 util/log.c
create mode 100644 util/log.h
create mode 100644 util/sysfs.c
create mode 100644 util/sysfs.h
6 years, 1 month
[PATCH v4 0/6] Add alignment check for DAX mount
by Toshi Kani
When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update. Add alignment check to ext4, ext2, and xfs.
- Patch 1-2 add bdev_dax_supported() which performs all the checks
necessary for dax mount.
- Patch 3-5 change fillesystems to call bdev_dax_supported().
- Patch 6 is a cleanup to keep dax capability checks consistent.
v4:
- blkdev_dax_capable() is similar to bdev_dax_supported().
Manage them consistently. (Dan Williams, Dave Chinner)
v3:
- Remove boilerplate code from filesytems (Christoph Hellwig)
- Add a helper function to perform all checks (Dave Chinner)
v2:
- Use a helper function via ->direct_access for the check.
(Christoph Hellwig)
- Call bdev_direct_access() with sector 0 for the check.
(Boaz Harrosh)
---
Toshi Kani (6):
1/6 block: Add vfs_msg() interface
2/6 block: Add bdev_dax_supported() for dax mount checks
3/6 ext4: Add alignment check for DAX mount
4/6 ext2: Add alignment check for DAX mount
5/6 xfs: Add alignment check for DAX mount
6/6 block: Update blkdev_dax_capable() for consistency
---
block/ioctl.c | 30 ----------------
fs/block_dev.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
fs/ext2/super.c | 11 ++----
fs/ext4/super.c | 11 ++----
fs/xfs/xfs_super.c | 12 +++----
include/linux/blkdev.h | 13 +++++++
include/linux/fs.h | 8 -----
7 files changed, 116 insertions(+), 65 deletions(-)
6 years, 1 month
[PATCH v3 0/5] "Device DAX" for persistent memory
by Dan Williams
Changes since v2 [1]:
1/ Allow libnvdimm drivers to omit a ->remove() method (Johannes)
2/ Fix memory leak due to missing ida_destroy() in drivers/nvdimm/ and
drivers/dax/ (Johannes)
3/ Mark some dev_dbg() instances as dev_info() (Johannes)
4/ Clarify RCU usage in dax.c (Johannes), acked-by Paul.
---
Device DAX is the device-centric analogue of Filesystem DAX
(CONFIG_FS_DAX). It allows memory ranges to be allocated and mapped
without need of an intervening file system or being bound to block
device semantics.
Why "Device DAX"?
1/ As I mentioned at LSF [2] we are starting to see platforms with
performance and feature differentiated memory ranges. Environments like
high-performance-computing and usages like in-memory databases want
exclusive allocation of a memory range with zero conflicting
kernel/metadata allocations. For dedicated applications of high
bandwidth or low latency memory device-DAX provides a predictable direct
map mechanism.
Note that this is only for the small number of "crazy" applications that
are willing to re-write to get every bit of performance. For everyone
else we, Dave Hansen and I, are looking to add a mechanism to hot-plug
device-DAX ranges into the mm to get general memory management services
(oversubscribe / migration, etc) with the understanding that it may
sacrifice some predictability.
2/ For persistent memory there are similar applications that are willing
to re-write to take full advantage of byte-addressable persistence.
This mechanism satisfies those usages that only need a pre-allocated
file to mmap.
3/ It answers Dave Chinner's call to start thinking about pmem-native
solutions. Device DAX specifically avoids block-device and file system
conflicts.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2016-May/005766.html
[2]: https://lwn.net/Articles/685107/
---
Dan Williams (5):
libnvdimm: stop requiring a driver ->remove() method
/dev/dax, pmem: direct access to persistent memory
/dev/dax, core: file operations and dax-mmap
Revert "block: enable dax for raw block devices"
libnvdimm: release ida resources
block/ioctl.c | 32 --
drivers/Kconfig | 2
drivers/Makefile | 1
drivers/dax/Kconfig | 26 ++
drivers/dax/Makefile | 4
drivers/dax/dax.c | 575 +++++++++++++++++++++++++++++++++++
drivers/dax/dax.h | 24 +
drivers/dax/pmem.c | 158 ++++++++++
drivers/nvdimm/bus.c | 9 -
drivers/nvdimm/core.c | 3
drivers/nvdimm/dimm_devs.c | 5
drivers/nvdimm/nd-core.h | 2
drivers/nvdimm/region_devs.c | 5
fs/block_dev.c | 96 ++----
include/linux/fs.h | 8
include/uapi/linux/fs.h | 1
mm/huge_memory.c | 1
mm/hugetlb.c | 1
tools/testing/nvdimm/Kbuild | 9 +
tools/testing/nvdimm/config_check.c | 2
20 files changed, 852 insertions(+), 112 deletions(-)
create mode 100644 drivers/dax/Kconfig
create mode 100644 drivers/dax/Makefile
create mode 100644 drivers/dax/dax.c
create mode 100644 drivers/dax/dax.h
create mode 100644 drivers/dax/pmem.c
6 years, 1 month