|
|
107cfb |
diff -uprN ndctl-65.orig/Documentation/daxctl/Makefile.am ndctl-65/Documentation/daxctl/Makefile.am
|
|
|
107cfb |
--- ndctl-65.orig/Documentation/daxctl/Makefile.am 2019-07-29 14:41:44.474017128 -0400
|
|
|
107cfb |
+++ ndctl-65/Documentation/daxctl/Makefile.am 2019-07-29 14:53:17.934283220 -0400
|
|
|
107cfb |
@@ -27,8 +27,7 @@ endif
|
|
|
107cfb |
|
|
|
107cfb |
man1_MANS = \
|
|
|
107cfb |
daxctl.1 \
|
|
|
107cfb |
- daxctl-list.1 \
|
|
|
107cfb |
- daxctl-migrate-device-model.1
|
|
|
107cfb |
+ daxctl-list.1
|
|
|
107cfb |
|
|
|
107cfb |
CLEANFILES = $(man1_MANS)
|
|
|
107cfb |
|
|
|
107cfb |
diff -uprN ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt
|
|
|
107cfb |
--- ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt 2019-07-29 14:41:44.473017124 -0400
|
|
|
107cfb |
+++ ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt 1969-12-31 19:00:00.000000000 -0500
|
|
|
107cfb |
@@ -1,47 +0,0 @@
|
|
|
107cfb |
-// SPDX-License-Identifier: GPL-2.0
|
|
|
107cfb |
-
|
|
|
107cfb |
-daxctl-migrate-device-model(1)
|
|
|
107cfb |
-==============================
|
|
|
107cfb |
-
|
|
|
107cfb |
-NAME
|
|
|
107cfb |
-----
|
|
|
107cfb |
-daxctl-migrate-device-model - Opt-in to the /sys/bus/dax device-model,
|
|
|
107cfb |
-allow for alternative Device-DAX instance drivers.
|
|
|
107cfb |
-
|
|
|
107cfb |
-SYNOPSIS
|
|
|
107cfb |
---------
|
|
|
107cfb |
-[verse]
|
|
|
107cfb |
-'daxctl migrate-device-model'
|
|
|
107cfb |
-
|
|
|
107cfb |
-Arrange for modprobe to disable the dax_pmem_compat, if present, and
|
|
|
107cfb |
-instead deploy the dax_pmem module to convert to the /sys/bus/dax model.
|
|
|
107cfb |
-Kernel versions prior to v5.1 may not support /sys/bus/dax in which case
|
|
|
107cfb |
-the result of this command is a nop until the kernel is updated. The
|
|
|
107cfb |
-motivation for changing from /sys/class/dax to /sys/bus/dax is to allow
|
|
|
107cfb |
-for alternative drivers for Device-DAX instances, in particular the
|
|
|
107cfb |
-dax_kmem driver.
|
|
|
107cfb |
-
|
|
|
107cfb |
-By default device-dax publishes a /dev/daxX.Y character device for
|
|
|
107cfb |
-userspace to directly map performance differentiated memory. This is
|
|
|
107cfb |
-fine if the memory is to be exclusively consumed / managed by userspace.
|
|
|
107cfb |
-Alternatively an administrator may want the kernel to manage the memory,
|
|
|
107cfb |
-make it available via malloc(), allow for over-provisioning, and / or
|
|
|
107cfb |
-apply kernel-based resource control schemes to the memory. In that case
|
|
|
107cfb |
-the memory fronted by a given Device-DAX instance can be assigned to the
|
|
|
107cfb |
-dax_kmem driver which arranges for the core-kernel memory-management
|
|
|
107cfb |
-sub-system to assume management of the memory range.
|
|
|
107cfb |
-
|
|
|
107cfb |
-This behavior is opt-in for consideration of existing applications /
|
|
|
107cfb |
-scripts that may be hard coded to use /sys/class/dax. Fixes have been
|
|
|
107cfb |
-submitted to applications known to have these direct dependencies
|
|
|
107cfb |
-http://git.kernel.dk/cgit/fio/commit/?id=b08e7d6b18b4[FIO]
|
|
|
107cfb |
-https://github.com/pmem/pmdk/commit/91bc8620884e[PMDK], however, there may
|
|
|
107cfb |
-be others and a system-owner should be aware of the potential for
|
|
|
107cfb |
-regression of Device-DAX consuming scripts, applications, or older
|
|
|
107cfb |
-daxctl binaries.
|
|
|
107cfb |
-
|
|
|
107cfb |
-The modprobe policy established by this utility becomes effective after
|
|
|
107cfb |
-the next reboot, or after all DAX related modules have been removed and
|
|
|
107cfb |
-re-loaded with "udevadm trigger"
|
|
|
107cfb |
-
|
|
|
107cfb |
-include::../copyright.txt[]
|
|
|
107cfb |
diff -uprN ndctl-65.orig/daxctl/Makefile.am ndctl-65/daxctl/Makefile.am
|
|
|
107cfb |
--- ndctl-65.orig/daxctl/Makefile.am 2019-07-29 14:41:44.486017168 -0400
|
|
|
107cfb |
+++ ndctl-65/daxctl/Makefile.am 2019-07-29 14:53:10.288257995 -0400
|
|
|
107cfb |
@@ -14,7 +14,6 @@ config.h: $(srcdir)/Makefile.am
|
|
|
107cfb |
daxctl_SOURCES =\
|
|
|
107cfb |
daxctl.c \
|
|
|
107cfb |
list.c \
|
|
|
107cfb |
- migrate.c \
|
|
|
107cfb |
../util/json.c
|
|
|
107cfb |
|
|
|
107cfb |
daxctl_LDADD =\
|
|
|
107cfb |
diff -uprN ndctl-65.orig/daxctl/builtin.h ndctl-65/daxctl/builtin.h
|
|
|
107cfb |
--- ndctl-65.orig/daxctl/builtin.h 2019-07-29 14:41:44.486017168 -0400
|
|
|
107cfb |
+++ ndctl-65/daxctl/builtin.h 2019-07-29 14:53:10.288257995 -0400
|
|
|
107cfb |
@@ -5,5 +5,4 @@
|
|
|
107cfb |
|
|
|
107cfb |
struct daxctl_ctx;
|
|
|
107cfb |
int cmd_list(int argc, const char **argv, struct daxctl_ctx *ctx);
|
|
|
107cfb |
-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx);
|
|
|
107cfb |
#endif /* _DAXCTL_BUILTIN_H_ */
|
|
|
107cfb |
diff -uprN ndctl-65.orig/daxctl/daxctl.c ndctl-65/daxctl/daxctl.c
|
|
|
107cfb |
--- ndctl-65.orig/daxctl/daxctl.c 2019-07-29 14:41:44.486017168 -0400
|
|
|
107cfb |
+++ ndctl-65/daxctl/daxctl.c 2019-07-29 14:53:10.288257995 -0400
|
|
|
107cfb |
@@ -70,7 +70,6 @@ static struct cmd_struct commands[] = {
|
|
|
107cfb |
{ "version", .d_fn = cmd_version },
|
|
|
107cfb |
{ "list", .d_fn = cmd_list },
|
|
|
107cfb |
{ "help", .d_fn = cmd_help },
|
|
|
107cfb |
- { "migrate-device-model", .d_fn = cmd_migrate },
|
|
|
107cfb |
};
|
|
|
107cfb |
|
|
|
107cfb |
int main(int argc, const char **argv)
|
|
|
107cfb |
diff -uprN ndctl-65.orig/daxctl/migrate.c ndctl-65/daxctl/migrate.c
|
|
|
107cfb |
--- ndctl-65.orig/daxctl/migrate.c 2019-07-29 14:41:44.487017171 -0400
|
|
|
107cfb |
+++ ndctl-65/daxctl/migrate.c 1969-12-31 19:00:00.000000000 -0500
|
|
|
107cfb |
@@ -1,41 +0,0 @@
|
|
|
107cfb |
-/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
107cfb |
-/* Copyright(c) 2019 Intel Corporation. All rights reserved. */
|
|
|
107cfb |
-#include <sys/types.h>
|
|
|
107cfb |
-#include <sys/stat.h>
|
|
|
107cfb |
-#include <stdio.h>
|
|
|
107cfb |
-#include <errno.h>
|
|
|
107cfb |
-#include <fcntl.h>
|
|
|
107cfb |
-#include <daxctl/config.h>
|
|
|
107cfb |
-#include <daxctl/libdaxctl.h>
|
|
|
107cfb |
-#include <util/parse-options.h>
|
|
|
107cfb |
-#include <ccan/array_size/array_size.h>
|
|
|
107cfb |
-
|
|
|
107cfb |
-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx)
|
|
|
107cfb |
-{
|
|
|
107cfb |
- int i;
|
|
|
107cfb |
- static const struct option options[] = {
|
|
|
107cfb |
- OPT_END(),
|
|
|
107cfb |
- };
|
|
|
107cfb |
- const char * const u[] = {
|
|
|
107cfb |
- "daxctl migrate-device-model",
|
|
|
107cfb |
- NULL
|
|
|
107cfb |
- };
|
|
|
107cfb |
-
|
|
|
107cfb |
- argc = parse_options(argc, argv, options, u, 0);
|
|
|
107cfb |
- for (i = 0; i < argc; i++)
|
|
|
107cfb |
- error("unknown parameter \"%s\"\n", argv[i]);
|
|
|
107cfb |
-
|
|
|
107cfb |
- if (argc)
|
|
|
107cfb |
- usage_with_options(u, options);
|
|
|
107cfb |
-
|
|
|
107cfb |
- if (symlink(DAXCTL_MODPROBE_DATA, DAXCTL_MODPROBE_INSTALL) == 0) {
|
|
|
107cfb |
- fprintf(stderr, " success: installed %s\n",
|
|
|
107cfb |
- DAXCTL_MODPROBE_INSTALL);
|
|
|
107cfb |
- return EXIT_SUCCESS;
|
|
|
107cfb |
- }
|
|
|
107cfb |
-
|
|
|
107cfb |
- error("failed to install %s: %s\n", DAXCTL_MODPROBE_INSTALL,
|
|
|
107cfb |
- strerror(errno));
|
|
|
107cfb |
-
|
|
|
107cfb |
- return EXIT_FAILURE;
|
|
|
107cfb |
-}
|