aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2016-07-29 10:39:21 +0800
committerFengguang Wu <fengguang.wu@intel.com>2016-07-29 10:44:22 +0800
commit935dd54042aa3136d8056b68d51295d1e7faba3f (patch)
treef83ba925277fa02db0abaf6acac687bff27f5464
parent0507846f479dbf41177a680fa95850605564e735 (diff)
downloadvm-scalability-935dd54042aa3136d8056b68d51295d1e7faba3f.tar.gz
ROTATE_BYTES: prevent OOM due to page table size too large
Cases that use ROTATE_BYTES as its unit_size use all the memory as file backed read only memory and are easily reclaimed; but the memory consumed by page table is not reclaimable and could cause OOM since ROTATE_BYTES is pretty large. Refine ROTATE_BYTES in hw_vars as is done in case-anon-r-rand so that other test cases will also avoid the OOM issue. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rwxr-xr-xcase-anon-r-rand3
-rwxr-xr-xcase-anon-r-rand-mt3
-rwxr-xr-xhw_vars2
3 files changed, 2 insertions, 6 deletions
diff --git a/case-anon-r-rand b/case-anon-r-rand
index f829738..e8ee976 100755
--- a/case-anon-r-rand
+++ b/case-anon-r-rand
@@ -2,7 +2,4 @@
. ./hw_vars
-# prevent OOM: limit pagetable pages to half memory
-[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 ))
-
$USEMEM -n $nr_task --readonly --random $((ROTATE_BYTES / nr_task))
diff --git a/case-anon-r-rand-mt b/case-anon-r-rand-mt
index 0838756..fa347d6 100755
--- a/case-anon-r-rand-mt
+++ b/case-anon-r-rand-mt
@@ -2,7 +2,4 @@
. ./hw_vars
-# prevent OOM: limit pagetable pages to half memory
-[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 ))
-
$USEMEM -t $nr_task --readonly --random $((ROTATE_BYTES / nr_task))
diff --git a/hw_vars b/hw_vars
index d47592f..c0fd413 100755
--- a/hw_vars
+++ b/hw_vars
@@ -134,6 +134,8 @@ mem=$((MemTotal << 10))
hugepagesize=$((Hugepagesize << 10))
ROTATE_BYTES=$((1<<42))
+# prevent OOM: limit pagetable pages to half memory
+[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 ))
# Documentation/x86/x86_64/mm.txt
# 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm