From 924b957ae4fc7f18d6a94bfe48f25af8c839e4fa Mon Sep 17 00:00:00 2001 From: Benas Date: Tue, 19 Mar 2019 17:46:37 +0000 Subject: [PATCH 1/5] add support for non-numa nodes --- .idea/codeStyles/Project.xml | 29 ++++ .idea/eRPC.iml | 8 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 300 +++++++++++++++++++++++++++++++++++ src/nexus_impl/nexus.cc | 2 +- src/rpc_constants.h | 7 + src/rpc_impl/rpc.cc | 2 +- src/util/huge_alloc.cc | 116 ++++++++------ src/util/numautils.h | 6 +- 11 files changed, 434 insertions(+), 56 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/eRPC.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..30aa626c --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/eRPC.iml b/.idea/eRPC.iml new file mode 100644 index 00000000..bc2cd874 --- /dev/null +++ b/.idea/eRPC.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..28a804d8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..9482e205 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..298a2b6b --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + shm_region_t + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - 1553016313208 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 4d1ce76627c562eb7364b74106dbde4475796f8c Mon Sep 17 00:00:00 2001 From: Benas Date: Tue, 19 Mar 2019 17:55:28 +0000 Subject: [PATCH 3/5] add support for non-numa nodes --- src/rpc_constants.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc_constants.h b/src/rpc_constants.h index 0ac2b9ef..fed650fd 100644 --- a/src/rpc_constants.h +++ b/src/rpc_constants.h @@ -41,7 +41,7 @@ static constexpr size_t kMaxNumaNodes = 8; * @relates Rpc * @brief Identifier for using heap memory instead of NUMA memory. */ -static constexpr size_t kNoNumaNode = -1; +static constexpr size_t kNoNumaNode = 10000; @@ -49,7 +49,7 @@ static constexpr size_t kNoNumaNode = -1; * @relates Rpc * @brief Maximum number of background threads per process */ -static constexpr size_t kMaxBgThreads = 8; +static constexpr size_t kMaxBgThreads = UINT8_MAX - 1; /** * @relates Rpc From f1167680e0e48704894d32ea1a216942328d775e Mon Sep 17 00:00:00 2001 From: Benas Date: Tue, 19 Mar 2019 17:59:35 +0000 Subject: [PATCH 4/5] add support for non-numa nodes --- src/util/huge_alloc.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/huge_alloc.cc b/src/util/huge_alloc.cc index a4b2fbab..1b943727 100644 --- a/src/util/huge_alloc.cc +++ b/src/util/huge_alloc.cc @@ -68,11 +68,12 @@ Buffer HugeAlloc::alloc_raw(size_t size, DoRegister do_register) { size = round_up(size); int shm_key, shm_id; + uint8_t *shm_buf; if (numa_node == kMaxNumaNodes) { // special case shm_key = 0; shm_id = 0; - uint8_t *shm_buf = static_cast(malloc(size)); + shm_buf = static_cast(malloc(size)); } else { @@ -119,7 +120,7 @@ Buffer HugeAlloc::alloc_raw(size_t size, DoRegister do_register) { } } - uint8_t *shm_buf = static_cast(shmat(shm_id, nullptr, 0)); + shm_buf = static_cast(shmat(shm_id, nullptr, 0)); rt_assert(shm_buf != nullptr, "eRPC HugeAlloc: shmat() failed. Key = " + std::to_string(shm_key)); From d481785e2a148afbd79de3345325b499f4b28c61 Mon Sep 17 00:00:00 2001 From: Benas Date: Tue, 19 Mar 2019 18:22:44 +0000 Subject: [PATCH 5/5] fixed definitions --- src/rpc_constants.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc_constants.h b/src/rpc_constants.h index fed650fd..21415567 100644 --- a/src/rpc_constants.h +++ b/src/rpc_constants.h @@ -41,7 +41,7 @@ static constexpr size_t kMaxNumaNodes = 8; * @relates Rpc * @brief Identifier for using heap memory instead of NUMA memory. */ -static constexpr size_t kNoNumaNode = 10000; +static constexpr size_t kNoNumaNode = UINT8_MAX - 1; @@ -49,7 +49,7 @@ static constexpr size_t kNoNumaNode = 10000; * @relates Rpc * @brief Maximum number of background threads per process */ -static constexpr size_t kMaxBgThreads = UINT8_MAX - 1; +static constexpr size_t kMaxBgThreads = 8; /** * @relates Rpc