numam-spdk/examples/bdev/fio_plugin
Tomasz Zawadzki 154eb3399a thread: add spdk_thread_is_idle()
This function add possibility to check if there are any scheduled operations
on particular thread.

Return from spdk_thread_poll() will be used as a way to load-balance and
signify if any work was performed during the single iteration.
A poller could return 0, but still be registered.

This helps especially in fio_plugin that only checked active_pollers or
messages via spdk_thread_poll().

Change-Id: Id6237278eb3b4bd4922b2abaa3c8ebd5e434d45d
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/445915
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-01 21:38:02 +00:00
..
.gitignore bdev: Add an example fio plugin 2017-08-04 20:03:37 -04:00
bdev.conf.in bdev: Add an example fio plugin 2017-08-04 20:03:37 -04:00
example_config.fio bdev: Add an example fio plugin 2017-08-04 20:03:37 -04:00
fio_plugin.c thread: add spdk_thread_is_idle() 2019-03-01 21:38:02 +00:00
full_bench.fio bdev: Add an example fio plugin 2017-08-04 20:03:37 -04:00
Makefile fio_plugin: fix hang in FIO 2019-02-11 09:18:26 +00:00
README.md CHANGELOG: add fio 3.3 support 2018-01-11 15:02:54 -05:00

Compiling fio

Clone the fio source repository from https://github.com/axboe/fio

git clone https://github.com/axboe/fio

Then check out the fio 3.3:

cd fio && git checkout fio-3.3

Finally, compile the code:

make

Compiling SPDK

Clone the SPDK source repository from https://github.com/spdk/spdk

git clone https://github.com/spdk/spdk
git submodule update --init

Then, run the SPDK configure script to enable fio (point it to the root of the fio repository):

cd spdk
./configure --with-fio=/path/to/fio/repo <other configuration options>

Finally, build SPDK:

make

Note to advanced users: These steps assume you're using the DPDK submodule. If you are using your own version of DPDK, the fio plugin requires that DPDK be compiled with -fPIC. You can compile DPDK with -fPIC by modifying your DPDK configuration file and adding the line:

EXTRA_CFLAGS=-fPIC

Usage

To use the SPDK fio plugin with fio, specify the plugin binary using LD_PRELOAD when running fio and set ioengine=spdk_bdev in the fio configuration file (see example_config.fio in the same directory as this README).

LD_PRELOAD=<path to spdk repo>/examples/bdev/fio_plugin/fio_plugin fio

The fio configuration file must contain one new parameter:

spdk_conf=./examples/bdev/fio_plugin/bdev.conf

This must point at an SPDK configuration file. There are a number of example configuration files in the SPDK repository under etc/spdk.

You can specify which block device to run against by setting the filename parameter to the block device name:

filename=Malloc0

Or for NVMe devices:

filename=Nvme0n1

Currently the SPDK fio plugin is limited to the thread usage model, so fio jobs must also specify thread=1 when using the SPDK fio plugin.

fio also currently has a race condition on shutdown if dynamically loading the ioengine by specifying the engine's full path via the ioengine parameter - LD_PRELOAD is recommended to avoid this race condition.

When testing random workloads, it is recommended to set norandommap=1. fio's random map processing consumes extra CPU cycles which will degrade performance over time with the fio_plugin since all I/O are submitted and completed on a single CPU core.