From 231087ae4b134fd5f353e8efad9874f03cad2203 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Mon, 19 Mar 2018 13:34:42 +0100 Subject: [PATCH] examples/fio_plugin: add --spdk_single_seg option Change-Id: Idbfea102b576ca2a0062d8f8b1dec51c02b99605 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/404317 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- examples/bdev/fio_plugin/fio_plugin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index f0cfc8ad9..60f775fd5 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -50,6 +50,7 @@ struct spdk_fio_options { void *pad; char *conf; unsigned mem_mb; + bool mem_single_seg; }; /* Used to pass messages between fio threads */ @@ -250,6 +251,7 @@ spdk_fio_init_env(struct thread_data *td) if (eo->mem_mb) { opts.mem_size = eo->mem_mb; } + opts.hugepage_single_segments = eo->mem_single_seg; if (spdk_env_init(&opts) < 0) { SPDK_ERRLOG("Unable to initialize SPDK env\n"); @@ -628,6 +630,15 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, + { + .name = "spdk_single_seg", + .lname = "SPDK switch to create just a single hugetlbfs file", + .type = FIO_OPT_BOOL, + .off1 = offsetof(struct spdk_fio_options, mem_single_seg), + .help = "If set to 1, SPDK will use just a single hugetlbfs file", + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_INVALID, + }, { .name = NULL, },