You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/05/08 19:55:11 UTC
mesos git commit: Changed BalloonExecutor to do memset before mlock.
Repository: mesos
Updated Branches:
refs/heads/master 115db9250 -> 7d2d5de9b
Changed BalloonExecutor to do memset before mlock.
mlock returns error when requested memory is more than the limit,
because it couldn't find enough lockable memory, which defeats the
purpose to trigger an oom.
Review: https://reviews.apache.org/r/33990
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7d2d5de9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7d2d5de9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7d2d5de9
Branch: refs/heads/master
Commit: 7d2d5de9b9f6adbb94cf692576236424aeaf2f67
Parents: 115db92
Author: Chi Zhang <ch...@gmail.com>
Authored: Fri May 8 10:54:14 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri May 8 10:54:40 2015 -0700
----------------------------------------------------------------------
src/examples/balloon_executor.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7d2d5de9/src/examples/balloon_executor.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_executor.cpp b/src/examples/balloon_executor.cpp
index ad1d861..6166f51 100644
--- a/src/examples/balloon_executor.cpp
+++ b/src/examples/balloon_executor.cpp
@@ -57,15 +57,15 @@ static void balloon(size_t limit)
abort();
}
- // We use mlock and memset here to make sure that the memory
+ // We use memset and mlock here to make sure that the memory
// actually gets paged in and thus accounted for.
- if (mlock(buffer, chunk) != 0) {
- perror("Failed to lock memory, mlock");
+ if (memset(buffer, 1, chunk) != buffer) {
+ perror("Failed to fill memory, memset");
abort();
}
- if (memset(buffer, 1, chunk) != buffer) {
- perror("Failed to fill memory, memset");
+ if (mlock(buffer, chunk) != 0) {
+ perror("Failed to lock memory, mlock");
abort();
}