This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push: new 201cd207f9 [Enhancement][Vectorized] Improve hash table build efficiency (#9250) 201cd207f9 is described below commit 201cd207f92ef604c2ede2492a3aa6537e2606b7 Author: jacktengg <18241664+jackte...@users.noreply.github.com> AuthorDate: Fri Apr 29 14:26:33 2022 +0800 [Enhancement][Vectorized] Improve hash table build efficiency (#9250) 1. MAP_POPULATE is missing for mmap in Allocator, because macro OS_LINUX is not defined in allocator.h; 2. MAP_POPULATE has no effect for mremap as for mmap, zero-fill enlarged memory range explicitly to pre-fault the pages --- be/CMakeLists.txt | 8 ++++++++ be/src/vec/common/allocator.h | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index aed9103ec3..abad57d879 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -43,6 +43,14 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64le.*|PPC64LE.*)") set (ARCH_PPC64LE 1) endif () +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + set (OS_LINUX 1) + add_definitions(-D OS_LINUX) +elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set (OS_MACOSX 1) + add_definitions(-D OS_MACOSX) +endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set (COMPILER_GCC 1) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") diff --git a/be/src/vec/common/allocator.h b/be/src/vec/common/allocator.h index 216864dbb8..0c8cfc6490 100644 --- a/be/src/vec/common/allocator.h +++ b/be/src/vec/common/allocator.h @@ -152,6 +152,13 @@ public: } /// No need for zero-fill, because mmap guarantees it. + + if constexpr (mmap_populate) { + // MAP_POPULATE seems have no effect for mremap as for mmap, + // Clear enlarged memory range explicitly to pre-fault the pages + if (new_size > old_size) + memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); + } } else if (new_size < MMAP_THRESHOLD) { /// Small allocs that requires a copy. Assume there's enough memory in system. Call CurrentMemoryTracker once. // CurrentMemoryTracker::realloc(old_size, new_size); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org