diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/include/odp_config_internal.h | 10 | ||||
-rw-r--r-- | platform/linux-generic/odp_ishm.c | 16 | ||||
-rw-r--r-- | platform/linux-generic/test/process-mode.conf | 5 |
3 files changed, 18 insertions, 13 deletions
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 65f751972..642de685c 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -129,16 +129,6 @@ extern "C" { #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48) /* - * Size of the virtual address space pre-reserver for ISHM - * - * This is just virtual space preallocation size, not memory allocation. - * This address space is used by ISHM to map things at a common address in - * all ODP threads (when the _ODP_ISHM_SINGLE_VA flag is used). - * In bytes. - */ -#define ODP_CONFIG_ISHM_VA_PREALLOC_SZ (1024 * 1024 * 1024L) - -/* * Maximum event burst size * * This controls the burst size on various enqueue, dequeue, etc calls. Large diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index da982e183..f8af8f79c 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1499,11 +1499,23 @@ int _odp_ishm_init_global(const odp_init_t *init) void *addr; void *spce_addr; int i; + int single_va_size_kb = 0; uid_t uid; char *hp_dir = odp_global_ro.hugepage_info.default_huge_page_dir; uint64_t align; - uint64_t max_memory = ODP_CONFIG_ISHM_VA_PREALLOC_SZ; - uint64_t internal = ODP_CONFIG_ISHM_VA_PREALLOC_SZ / 8; + uint64_t max_memory; + uint64_t internal; + + if (!_odp_libconfig_lookup_ext_int("shm", NULL, "single_va_size_kb", + &single_va_size_kb)) { + ODP_ERR("Unable to read single VA size from config\n"); + return -1; + } + + ODP_DBG("Shm single VA size: %dkB\n", single_va_size_kb); + + max_memory = single_va_size_kb * 1024; + internal = max_memory / 8; /* user requested memory size + some extra for internal use */ if (init && init->shm.max_memory) diff --git a/platform/linux-generic/test/process-mode.conf b/platform/linux-generic/test/process-mode.conf index f631f54bc..a86562f6e 100644 --- a/platform/linux-generic/test/process-mode.conf +++ b/platform/linux-generic/test/process-mode.conf @@ -1,10 +1,13 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.3" +config_file_version = "0.1.4" # Shared memory options shm: { # Override default option and allocate internal shms using single # virtual address space. single_va = 1 + + # Increase the amount of single VA memory + single_va_size_kb = 1048576 } |