You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/28 02:20:17 UTC

[GitHub] [incubator-doris] jacktengg commented on a diff in pull request #9250: [Enhancement][Vectorized] Improve hash table build efficiency

jacktengg commented on code in PR #9250:
URL: https://github.com/apache/incubator-doris/pull/9250#discussion_r860402567


##########
be/src/vec/common/allocator.h:
##########
@@ -146,8 +146,13 @@ class Allocator {
                                                           std::to_string(old_size) + " to " +
                                                           std::to_string(new_size) + ".",
                                                   doris::TStatusCode::VEC_CANNOT_MREMAP);
-
             /// No need for zero-fill, because mmap guarantees it.
+
+            if constexpr (mmap_populate)
+                // MAP_POPULATE seems have no effect for mremap as for mmap,
+                // Zero-fill 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);

Review Comment:
   memset explicitly here is for pre-pault the page, not for zero fill. As I tested, MAP_POPULATE seems have no effect for mremap as for mmap.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org