aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFengguang Wu <fengguang.wu@intel.com>2018-12-19 15:15:32 +0800
committerFengguang Wu <fengguang.wu@intel.com>2018-12-24 11:29:15 +0800
commitaca1bb4f8b4f6e17417e5b8e61a09991ae4cc923 (patch)
tree6d4edbb90e1e554391f5a79135e4b957ba42626c
parent421cf7db2b44ac9eb508840bcbfbb6076c8d90a6 (diff)
downloadvm-scalability-aca1bb4f8b4f6e17417e5b8e61a09991ae4cc923.tar.gz
usemem: warn on invalid option combinations
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rw-r--r--usemem.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usemem.c b/usemem.c
index 32ab9b9..3d7a829 100644
--- a/usemem.c
+++ b/usemem.c
@@ -993,6 +993,18 @@ int main(int argc, char *argv[])
}
}
+ if (opt_malloc) {
+ if (map_populate|map_anonymous|map_hugetlb)
+ fprintf(stderr,
+ "%s: mmap options ignored for malloc()\n",
+ ourname);
+ } else {
+ if (map_hugetlb && !map_anonymous)
+ fprintf(stderr,
+ "%s: MAP_HUGETLB relies on MAP_ANONYMOUS\n",
+ ourname);
+ }
+
if (pipe(start_ready_fds) || pipe(start_wake_fds) ||
pipe(free_ready_fds) || pipe(free_wake_fds)) {
fprintf(stderr, "%s: failed to create pipes: %s\n",