arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pcmor...@apache.org
Subject arrow git commit: ARROW-1410: Remove MAP_POPULATE flag when mmapping files in Plasma store.
Date Fri, 25 Aug 2017 18:45:53 GMT
Repository: arrow
Updated Branches:
  refs/heads/master f50f2eacb -> a3607d2a4


ARROW-1410: Remove MAP_POPULATE flag when mmapping files in Plasma store.

cc @pcmoritz @atumanov

Author: Robert Nishihara <robertnishihara@gmail.com>

Closes #992 from robertnishihara/removemappopulate and squashes the following commits:

8ed9612 [Robert Nishihara] Remove unnecessary ifdef.
7b75bd9 [Robert Nishihara] Remove MAP_POPULATE flag when mmapping files in Plasma store.


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/a3607d2a
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/a3607d2a
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/a3607d2a

Branch: refs/heads/master
Commit: a3607d2a4683dd364f36d29cdaf4761a6000ea7d
Parents: f50f2ea
Author: Robert Nishihara <robertnishihara@gmail.com>
Authored: Fri Aug 25 11:45:19 2017 -0700
Committer: Philipp Moritz <pcmoritz@gmail.com>
Committed: Fri Aug 25 11:45:19 2017 -0700

----------------------------------------------------------------------
 cpp/src/plasma/malloc.cc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/a3607d2a/cpp/src/plasma/malloc.cc
----------------------------------------------------------------------
diff --git a/cpp/src/plasma/malloc.cc b/cpp/src/plasma/malloc.cc
index 6b9bc62..52d3620 100644
--- a/cpp/src/plasma/malloc.cc
+++ b/cpp/src/plasma/malloc.cc
@@ -134,14 +134,10 @@ void* fake_mmap(size_t size) {
 
   int fd = create_buffer(size);
   ARROW_CHECK(fd >= 0) << "Failed to create buffer during mmap";
-#ifdef __linux__
-  // MAP_POPULATE will pre-populate the page tables for this memory region
-  // which avoids work when accessing the pages later. Only supported on Linux.
-  void* pointer =
-      mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, fd, 0);
-#else
+  // MAP_POPULATE can be used to pre-populate the page tables for this memory region
+  // which avoids work when accessing the pages later. However it causes long pauses
+  // when mmapping the files. Only supported on Linux.
   void* pointer = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-#endif
   if (pointer == MAP_FAILED) {
     ARROW_LOG(ERROR) << "mmap failed with error: " << std::strerror(errno);
     if (errno == ENOMEM && plasma::plasma_config->hugepages_enabled) {


Mime
View raw message