From 5e0a97223b10f751f7c2169200f2362c93fce3dd Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 30 Oct 2018 09:11:32 +0100 Subject: [PATCH] env/dpdk: always set base-virtaddr DPDK 18.11 sets the default base-virtaddr to an address that falls into an area reserved by ASAN. DPDK will try to remap its memory over and over with the closest base-virtaddr hint and for ASAN case this would take a huge amount of time. This was already raised on DPDK mailing list [1] and might be eventually fixed or worked around in upstream, but for now let's just override the default base-virtaddr to a value that ASAN is known not to occupy. [1] http://patches.dpdk.org/patch/46130/#88395 Change-Id: Ieada30e82355e8ead458e53795ab98cd12692c1c Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/431257 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448380 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/env_dpdk/init.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c index 1a2fafe15..64988d5c0 100644 --- a/lib/env_dpdk/init.c +++ b/lib/env_dpdk/init.c @@ -293,6 +293,17 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts) } #ifdef __linux__ + /* Set the base virtual address - it must be an address that is not in the + * ASAN shadow region, otherwise ASAN-enabled builds will ignore the + * mmap hint. + * + * Ref: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm + */ + args = spdk_push_arg(args, &argcount, _sprintf_alloc("--base-virtaddr=0x200000000000")); + if (args == NULL) { + return -1; + } + if (opts->shm_id < 0) { args = spdk_push_arg(args, &argcount, _sprintf_alloc("--file-prefix=spdk_pid%d", getpid())); @@ -306,17 +317,6 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts) return -1; } - /* Set the base virtual address - it must be an address that is not in the - * ASAN shadow region, otherwise ASAN-enabled builds will ignore the - * mmap hint. - * - * Ref: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm - */ - args = spdk_push_arg(args, &argcount, _sprintf_alloc("--base-virtaddr=0x200000000000")); - if (args == NULL) { - return -1; - } - /* set the process type */ args = spdk_push_arg(args, &argcount, _sprintf_alloc("--proc-type=auto")); if (args == NULL) {