aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jordan <daniel.m.jordan@oracle.com>2018-10-11 21:18:54 +0800
committerFengguang Wu <fengguang.wu@intel.com>2018-10-11 21:18:54 +0800
commitd8b6d3c51d1c4de6c0f6f4ef1c59d657c574a182 (patch)
tree4f0a55b04f105ed02b6567655fc13745fde12e33
parent203658fb11d324e83c93550970fc6365a2ccc9d6 (diff)
downloadvm-scalability-d8b6d3c51d1c4de6c0f6f4ef1c59d657c574a182.tar.gz
Revert "case-swap-w-seq: fix ignored --random in case-swap-w-rand-mt"
This reverts commit 203658fb11d324e83c93550970fc6365a2ccc9d6. Others prefer to keep the duplication down, and I'm all for that. Let's fix it a different way. Cc: Aaron Lu <aaron.lu@intel.com> Cc: Ying Huang <ying.huang@intel.com> Cc: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
l---------[-rwxr-xr-x]case-swap-w-rand13
l---------[-rwxr-xr-x]case-swap-w-rand-mt13
-rwxr-xr-xcase-swap-w-seq15
l---------[-rwxr-xr-x]case-swap-w-seq-mt13
4 files changed, 17 insertions, 37 deletions
diff --git a/case-swap-w-rand b/case-swap-w-rand
index c32687f..4fbca07 100755..120000
--- a/case-swap-w-rand
+++ b/case-swap-w-rand
@@ -1,12 +1 @@
-#!/bin/sh
-
-. ./hw_vars
-
-if [ "$SwapTotal" -eq 0 ]; then
- echo "No swap space. Please setup swap before running $0" >&2
- exit 1
-fi
-
-[ -n "$unit_size" ] || unit_size=$(( ((MemAvailable + SwapTotal) << 10) * 3 / 4))
-
-$USEMEM -n $nr_task --random $((unit_size / nr_task))
+case-swap-w-seq \ No newline at end of file
diff --git a/case-swap-w-rand-mt b/case-swap-w-rand-mt
index f38b559..4fbca07 100755..120000
--- a/case-swap-w-rand-mt
+++ b/case-swap-w-rand-mt
@@ -1,12 +1 @@
-#!/bin/sh
-
-. ./hw_vars
-
-if [ "$SwapTotal" -eq 0 ]; then
- echo "No swap space. Please setup swap before running $0" >&2
- exit 1
-fi
-
-[ -n "$unit_size" ] || unit_size=$(( ((MemAvailable + SwapTotal) << 10) * 3 / 4))
-
-$USEMEM -t $nr_task --random $((unit_size / nr_task))
+case-swap-w-seq \ No newline at end of file
diff --git a/case-swap-w-seq b/case-swap-w-seq
index 9f5760d..6e9f206 100755
--- a/case-swap-w-seq
+++ b/case-swap-w-seq
@@ -9,4 +9,17 @@ fi
[ -n "$unit_size" ] || unit_size=$(( ((MemAvailable + SwapTotal) << 10) * 3 / 4))
-$USEMEM -n $nr_task $((unit_size / nr_task))
+testcase=$(basename $0)
+if [ "${testcase%-mt}" != "$testcase" ]; then
+ multi_task_option="-t"
+else
+ multi_task_option="-n"
+fi
+
+if [ "${testcase%-rand}" != "$testcase" ]; then
+ rand_seq_option="--random"
+else
+ rand_seq_option=""
+fi
+
+$USEMEM $multi_task_option $nr_task $rand_seq_option $((unit_size / nr_task))
diff --git a/case-swap-w-seq-mt b/case-swap-w-seq-mt
index 475e386..4fbca07 100755..120000
--- a/case-swap-w-seq-mt
+++ b/case-swap-w-seq-mt
@@ -1,12 +1 @@
-#!/bin/sh
-
-. ./hw_vars
-
-if [ "$SwapTotal" -eq 0 ]; then
- echo "No swap space. Please setup swap before running $0" >&2
- exit 1
-fi
-
-[ -n "$unit_size" ] || unit_size=$(( ((MemAvailable + SwapTotal) << 10) * 3 / 4))
-
-$USEMEM -t $nr_task $((unit_size / nr_task))
+case-swap-w-seq \ No newline at end of file