From 104ee4dea7246d51d053076c55b917548dd0e7e2 Mon Sep 17 00:00:00 2001 From: Dave Jiang Date: Fri, 16 Dec 2016 15:59:06 -0700 Subject: [PATCH] fio: add additional support for dev-dax ioengine Fixup options.c to add the dev-dax to ioengine list. Update fio.1 and HOWTO as well. Also adding example fio job file. Signed-off-by: Dave Jiang Signed-off-by: Jens Axboe --- HOWTO | 3 +++ examples/dev-dax.fio | 45 ++++++++++++++++++++++++++++++++++++++++++++ fio.1 | 3 +++ options.c | 5 +++++ 4 files changed, 56 insertions(+) create mode 100644 examples/dev-dax.fio diff --git a/HOWTO b/HOWTO index bfc60be5..6893c868 100644 --- a/HOWTO +++ b/HOWTO @@ -819,6 +819,9 @@ ioengine=str Defines how the job issues io to the file. The following pmemblk Read and write through the NVML libpmemblk interface. + dev-dax Read and write through a DAX device exposed + from persistent memory. + external Prefix to specify loading an external IO engine object file. Append the engine filename, eg ioengine=external:/tmp/foo.o diff --git a/examples/dev-dax.fio b/examples/dev-dax.fio new file mode 100644 index 00000000..d9f430eb --- /dev/null +++ b/examples/dev-dax.fio @@ -0,0 +1,45 @@ +[global] +bs=2m +ioengine=dev-dax +norandommap +time_based=1 +runtime=30 +group_reporting +disable_lat=1 +disable_slat=1 +disable_clat=1 +clat_percentiles=0 +cpus_allowed_policy=split + +# For the dev-dax engine: +# +# IOs always complete immediately +# IOs are always direct +# +iodepth=1 +direct=0 +thread=1 +numjobs=16 +# +# The dev-dax engine does IO to DAX device that are special character +# devices exported by the kernel (e.g. /dev/dax0.0). The device is +# opened normally and then the region is accessible via mmap. We do +# not use the O_DIRECT flag because the device is naturally direct +# access. The O_DIRECT flags will result in failure. The engine +# access the underlying NVDIMM directly once the mmapping is setup. +# +# Check the alignment requirement of your DAX device. Currently the default +# should be 2M. Blocksize (bs) should meet alignment requirement. +# +# An example of creating a dev dax device node from pmem: +# ndctl create-namespace --reconfig=namespace0.0 --mode=dax --force +# +filename=/dev/dax0.0 + +[dev-dax-write] +rw=randwrite +stonewall + +[dev-dax-read] +rw=randread +stonewall diff --git a/fio.1 b/fio.1 index 270798a4..e8a327c9 100644 --- a/fio.1 +++ b/fio.1 @@ -722,6 +722,9 @@ constraint. .TP .B pmemblk Read and write through the NVML libpmemblk interface. +.TP +.B dev-dax +Read and write through a DAX device exposed from persistent memory. .RE .P .RE diff --git a/options.c b/options.c index 4c4f52c0..7638afc0 100644 --- a/options.c +++ b/options.c @@ -1769,6 +1769,11 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .help = "NVML libpmemblk based IO engine", }, +#endif +#ifdef CONFIG_LINUX_DEVDAX + { .ival = "dev-dax", + .help = "DAX Device based IO engine", + }, #endif { .ival = "external", .help = "Load external engine (append name)", -- 2.25.1