From c5840d77b39fde84abe74a5b76c5a4d0e472a6ab Mon Sep 17 00:00:00 2001 From: John Kariuki Date: Fri, 18 Sep 2020 12:41:57 -0700 Subject: [PATCH] test/bdev_perf: disable zcopy by default Prior to this patch the bdevperf application enabled using the zcopy API by default. This means that on bdevs that don't natively support zcopy the API emulates zero-copy by allocating a buffer. In my test environment, I measured a 25% decrease in IOPS when zcopy was enabled. This patch changes the default value so that zcopy is disabled by default. For bdevs that support zcopy, use the -Z flag to enable using zcopy API. Change-Id: Ib7e5c24f76eb16ffef038687daca58c0ffad1c1c Signed-off-by: John Kariuki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4324 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- CHANGELOG.md | 7 +++++++ test/bdev/bdevperf/bdevperf.c | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c53f681f..c7954a754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -131,6 +131,13 @@ library now no longer exists. The contents of the bdev_rpc library have been moved to the bdev library. The app_rpc library now no longer exists. +The bdevperf application now disables the zcopy API by default. Prior to this change, +bdevperf enabled using the zcopy API by default which caused a performance impact of +up to 25% on bdevs that don't natively support zcopy because the API emulates zero-copy +by allocating a buffer. The bdevperf `-x` param was renamed to `-Z` and the default +value changed to false. For bdevs that support zcopy, use the -Z flag to enable +using zcopy API. + ### nvmf Add 'no_wr_batching' parameter to 'spdk_nvmf_transport_opts' struct to disable diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index 70f4d73ff..4d11aea83 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -80,7 +80,7 @@ static uint64_t g_show_performance_ema_period = 0; static int g_run_rc = 0; static bool g_shutdown = false; static uint64_t g_shutdown_tsc; -static bool g_zcopy = true; +static bool g_zcopy = false; static struct spdk_thread *g_master_thread; static int g_time_in_sec = 0; static bool g_mix_specified = false; @@ -1929,8 +1929,8 @@ bdevperf_parse_arg(int ch, char *arg) g_job_bdev_name = optarg; } else if (ch == 'z') { g_wait_for_tests = true; - } else if (ch == 'x') { - g_zcopy = false; + } else if (ch == 'Z') { + g_zcopy = true; } else if (ch == 'A') { g_abort = true; } else if (ch == 'C') { @@ -1996,7 +1996,7 @@ bdevperf_usage(void) printf(" -S show performance result in real time every seconds\n"); printf(" -T bdev to run against. Default: all available bdevs.\n"); printf(" -f continue processing I/O even after failures\n"); - printf(" -x disable using zcopy bdev API for read or write I/O\n"); + printf(" -Z enable using zcopy bdev API for read or write I/O\n"); printf(" -z start bdevperf, but wait for RPC to start tests\n"); printf(" -A abort the timeout I/O\n"); printf(" -C enable every core to send I/Os to each bdev\n"); @@ -2112,7 +2112,7 @@ main(int argc, char **argv) opts.rpc_addr = NULL; opts.shutdown_cb = spdk_bdevperf_shutdown_cb; - if ((rc = spdk_app_parse_args(argc, argv, &opts, "xzfq:o:t:w:k:ACM:P:S:T:j:", NULL, + if ((rc = spdk_app_parse_args(argc, argv, &opts, "Zzfq:o:t:w:k:ACM:P:S:T:j:", NULL, bdevperf_parse_arg, bdevperf_usage)) != SPDK_APP_PARSE_ARGS_SUCCESS) { return rc;