You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/04/12 23:11:26 UTC

[2/2] mesos git commit: Containerizer: Transitioned codebase to use `os::pagesize`.

Containerizer: Transitioned codebase to use `os::pagesize`.

Review: https://reviews.apache.org/r/45944/


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

Branch: refs/heads/master
Commit: 2e76199a3dd977152110fbb474928873f31f7213
Parents: a170204
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Apr 12 13:35:40 2016 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Tue Apr 12 13:41:30 2016 -0700

----------------------------------------------------------------------
 src/examples/balloon_executor.cpp              | 4 +++-
 src/tests/containerizer/cgroups_tests.cpp      | 6 ++++--
 src/tests/containerizer/memory_test_helper.cpp | 4 +++-
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2e76199a/src/examples/balloon_executor.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_executor.cpp b/src/examples/balloon_executor.cpp
index 3992184..108ebd9 100644
--- a/src/examples/balloon_executor.cpp
+++ b/src/examples/balloon_executor.cpp
@@ -31,6 +31,8 @@
 #include <stout/numify.hpp>
 #include <stout/os.hpp>
 
+#include <stout/os/pagesize.hpp>
+
 using namespace mesos;
 
 
@@ -50,7 +52,7 @@ static void balloon(size_t limit)
 
     // Allocate page-aligned virtual memory.
     void* buffer = NULL;
-    if (posix_memalign(&buffer, getpagesize(), chunk) != 0) {
+    if (posix_memalign(&buffer, os::pagesize(), chunk) != 0) {
       perror("Failed to allocate page-aligned memory, posix_memalign");
       abort();
     }

http://git-wip-us.apache.org/repos/asf/mesos/blob/2e76199a/src/tests/containerizer/cgroups_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_tests.cpp b/src/tests/containerizer/cgroups_tests.cpp
index ecd83c7..4cb3d61 100644
--- a/src/tests/containerizer/cgroups_tests.cpp
+++ b/src/tests/containerizer/cgroups_tests.cpp
@@ -48,6 +48,8 @@
 #include <stout/stringify.hpp>
 #include <stout/strings.hpp>
 
+#include <stout/os/pagesize.hpp>
+
 #include "linux/cgroups.hpp"
 #include "linux/perf.hpp"
 
@@ -1129,12 +1131,12 @@ TEST_F(CgroupsAnyHierarchyMemoryPressureTest, ROOT_IncreaseRSS)
 
   // Use a guard to error out if it's been too long.
   // TODO(chzhcn): Use a better way to set testing time limit.
-  uint64_t iterationLimit = (limit.bytes() / getpagesize()) * 10;
+  uint64_t iterationLimit = (limit.bytes() / os::pagesize()) * 10;
   uint64_t i = 0;
   bool stable = true;
   while (i < iterationLimit) {
     if (stable) {
-      EXPECT_SOME(helper.increaseRSS(getpagesize()));
+      EXPECT_SOME(helper.increaseRSS(os::pagesize()));
     }
 
     Future<uint64_t> _low = counters[Level::LOW]->value();

http://git-wip-us.apache.org/repos/asf/mesos/blob/2e76199a/src/tests/containerizer/memory_test_helper.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/memory_test_helper.cpp b/src/tests/containerizer/memory_test_helper.cpp
index 92579a2..21c718d 100644
--- a/src/tests/containerizer/memory_test_helper.cpp
+++ b/src/tests/containerizer/memory_test_helper.cpp
@@ -35,6 +35,8 @@
 #include <stout/strings.hpp>
 #include <stout/try.hpp>
 
+#include <stout/os/pagesize.hpp>
+
 #include "tests/flags.hpp"
 #include "tests/utils.hpp"
 
@@ -84,7 +86,7 @@ static Try<void*> allocateRSS(const Bytes& size)
 #endif
 
   void* rss = NULL;
-  if (posix_memalign(&rss, getpagesize(), size.bytes()) != 0) {
+  if (posix_memalign(&rss, os::pagesize(), size.bytes()) != 0) {
     return ErrnoError("Failed to increase RSS memory, posix_memalign");
   }