Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 2 participants 2 messages Nov 18, 2017 – Nov 20, 2017 Kbuild

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit adf075fa89a7f3bbb45237f1440de0583833bd80:

ioengines: remove pointless list initializations (2017-11-16 20:03:15 -0700)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 40e5f1bf1aca5970528724873a4544c43712a75d:

Merge branch 'libpmem' (2017-11-17 09:21:19 -0700)

----------------------------------------------------------------
Jens Axboe (5):
Merge branch 'add-libpmem-engine' of https://github.com/tishizaki/fio into libpmem
libpmem: code cleanups
libpmem: move mmap alignment to init time
examples/libpmem.fio: clean up example
Merge branch 'libpmem'

Teruaki Ishizaki (1):
fio: add libpmem engine

 HOWTO                |   5 +
 Makefile             |   3 +
 configure            |   9 +
 engines/libpmem.c    | 591 +++++++++++++++++++++++++++++++++++++++++++++++++++
 examples/libpmem.fio |  73 +++++++
 fio.1                |   5 +
 options.c            |   5 +
 7 files changed, 691 insertions(+)
 create mode 100644 engines/libpmem.c
 create mode 100644 examples/libpmem.fio

---

Diff of recent changes:

HOWTO +5 -0
index 419fa73..dce96bc 100644
@@ -1820,6 +1820,11 @@ I/O engine
 			set  `filesize` so that all the accounting still occurs, but no
 			actual I/O will be done other than creating the file.
 
+		**libpmem**
+			Read and write using mmap I/O to a file on a filesystem
+			mounted with DAX on a persistent memory device through the NVML
+			libpmem library.
+
 I/O engine specific parameters
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Makefile +3 -0
index 2893348..3ce6064 100644
@@ -135,6 +135,9 @@ endif
 ifdef CONFIG_LINUX_DEVDAX
   SOURCE += engines/dev-dax.c
 endif
+ifdef CONFIG_LIBPMEM
+  SOURCE += engines/libpmem.c
+endif
 
 ifeq ($(CONFIG_TARGET_OS), Linux)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
configure +9 -0
index d34c000..31ba822 100755
@@ -142,6 +142,7 @@ gfio_check="no"
 libhdfs="no"
 pmemblk="no"
 devdax="no"
+pmem="no"
 disable_lex=""
 disable_pmem="no"
 prefix=/usr/local
@@ -1845,6 +1846,7 @@ print_config "libpmemblk" "$libpmemblk"
 
 # Choose the ioengines
 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
+  pmem="yes"
   devdax="yes"
   if test "$libpmemblk" = "yes"; then
     pmemblk="yes"
@@ -1860,6 +1862,10 @@ print_config "NVML pmemblk engine" "$pmemblk"
 print_config "NVML dev-dax engine" "$devdax"
 
 ##########################################
+# Report whether libpmem engine is enabled
+print_config "NVML libpmem engine" "$pmem"
+
+##########################################
 # Check if we have lex/yacc available
 yacc="no"
 yacc_is_bison="no"
@@ -2300,6 +2306,9 @@ fi
 if test "$devdax" = "yes" ; then
   output_sym "CONFIG_LINUX_DEVDAX"
 fi
+if test "$pmem" = "yes" ; then
+  output_sym "CONFIG_LIBPMEM"
+fi
 if test "$arith" = "yes" ; then
   output_sym "CONFIG_ARITHMETIC"
   if test "$yacc_is_bison" = "yes" ; then
engines/libpmem.c new file +591 -0

591 lines not on this page · raw message

examples/libpmem.fio new file +73 -0

73 lines not on this page · raw message

fio.1 +5 -0
index 1f9fffc..bd7670a 100644
@@ -1597,6 +1597,11 @@ details of writing an external I/O engine.
 Simply create the files and do no I/O to them.  You still need to set
 \fBfilesize\fR so that all the accounting still occurs, but no actual I/O will be
 done other than creating the file.
+.TP
+.B libpmem
+Read and write using mmap I/O to a file on a filesystem
+mounted with DAX on a persistent memory device through the NVML
+libpmem library.
 .SS "I/O engine specific parameters"
 In addition, there are some parameters which are only valid when a specific
 \fBioengine\fR is in use. These are used identically to normal parameters,
options.c +5 -0
index e8d1a3a..a0fcd8f 100644
@@ -1851,6 +1851,11 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 			    .help = "Load external engine (append name)",
 			    .cb = str_ioengine_external_cb,
 			  },
+#ifdef CONFIG_LIBPMEM
+			  { .ival = "libpmem",
+			    .help = "NVML libpmem based IO engine",
+			  },
+#endif
 		},
 	},
 	{
#1 lore raw
Quoted 6 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jens Axboe
Sent: Saturday, November 18, 2017 7:00 AM

...

Quoted 6 lines
engines/libpmem.c new file +6 -0
+/*
+ * Limits us to 1GiB of mapped files in total to model after
+ * libpmem engine behavior
+ */
+#define MMAP_TOTAL_SZ   (1 * 1024 * 1024 * 1024UL)
+

...

Quoted 5 lines
engines/libpmem.c new file +3 -0
+#define MEGABYTE ((uintptr_t)1 << 20)
+#define GIGABYTE ((uintptr_t)1 << 30)
+#define PROCMAXLEN 2048 /* maximum expected line length in /proc

files */
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))

...

Quoted 6 lines

+/*
+ * util_map_hint_align -- choose the desired mapping alignment
+ *
+ * Use 2MB/1GB page alignment only if the mapping length is at least
+ * twice as big as the page size.
+ */

...

Quoted 7 lines

+ * Except for Windows Environment:
+ * ALSR in 64-bit Linux kernel uses 28-bit of randomness for mmap
+ * (bit positions 12-39), which means the base mapping address is
randomized
+ * within [0..1024GB] range, with 4KB granularity. Assuming
additional
+ * 1GB alignment, it results in 1024 possible locations.

Please use the IEC prefixes for binary units in new code:
MEBIBYTE, GIBIBYTE, MiB, GiB, etc.

---
Robert Elliott, HPE Persistent Memory