diff options
author | Aaron Lu <aaron.lu@intel.com> | 2016-07-29 10:39:21 +0800 |
---|---|---|
committer | Fengguang Wu <fengguang.wu@intel.com> | 2016-07-29 10:44:22 +0800 |
commit | 935dd54042aa3136d8056b68d51295d1e7faba3f (patch) | |
tree | f83ba925277fa02db0abaf6acac687bff27f5464 | |
parent | 0507846f479dbf41177a680fa95850605564e735 (diff) | |
download | vm-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-x | case-anon-r-rand | 3 | ||||
-rwxr-xr-x | case-anon-r-rand-mt | 3 | ||||
-rwxr-xr-x | hw_vars | 2 |
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)) @@ -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 |