Repository: mesos Updated Branches: refs/heads/master d8f48cb4a -> 2f5e4492a
Fixed compile error in ppc64le. `PAGE_SIZE` is not declared in ppc64le, use `os::pagesize()` instead to support different platforms. Review: https://reviews.apache.org/r/52090/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2f5e4492 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2f5e4492 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2f5e4492 Branch: refs/heads/master Commit: 2f5e4492a4379c47e1ddb3370ac66725b210ee79 Parents: d8f48cb Author: haosdent huang <haosd...@gmail.com> Authored: Wed Sep 21 10:10:18 2016 -0700 Committer: Jie Yu <yujie....@gmail.com> Committed: Wed Sep 21 10:10:18 2016 -0700 ---------------------------------------------------------------------- .../mesos/isolators/cgroups/subsystems/memory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/2f5e4492/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp index bab10ae..5b3ce15 100644 --- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp +++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp @@ -15,7 +15,6 @@ // limitations under the License. #include <sys/types.h> -#include <sys/user.h> #include <climits> #include <sstream> @@ -27,6 +26,7 @@ #include <stout/bytes.hpp> #include <stout/error.hpp> #include <stout/option.hpp> +#include <stout/os.hpp> #include <stout/result.hpp> #include "common/protobuf_utils.hpp" @@ -224,10 +224,11 @@ Future<Nothing> MemorySubsystem::update( // value which may be one of following possible values: // * LONG_MAX (Linux Kernel Version < 3.12) // * ULONG_MAX (3.12 <= Linux Kernel Version < 3.19) - // * LONG_MAX / PAGE_SIZE * PAGE_SIZE (Linux Kernel Version >= 3.19) + // * LONG_MAX / pageSize * pageSize (Linux Kernel Version >= 3.19) // Thus, if 'currentLimit' is greater or equals to 'initialLimit' // below, we know it's the first time. - Bytes initialLimit(static_cast<uint64_t>(LONG_MAX / PAGE_SIZE * PAGE_SIZE)); + static const size_t pageSize = os::pagesize(); + Bytes initialLimit(static_cast<uint64_t>(LONG_MAX / pageSize * pageSize)); if (currentLimit.get() >= initialLimit || limit > currentLimit.get()) { // We always set limit_in_bytes first and optionally set