aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2018-03-26 13:13:07 +0800
committerFengguang Wu <fengguang.wu@intel.com>2018-03-28 19:33:56 +0800
commit8214cd45d08363646364ce502671daedae1ddf36 (patch)
tree0088f6ba9cdad6aeed1602f0935d7d4edc454e58
parentf95df6b630cdf22108bab5859ce9a86ad5924516 (diff)
downloadvm-scalability-8214cd45d08363646364ce502671daedae1ddf36.tar.gz
case-shm-pread: use unit_size to control working set
For multi-threaded case, when it needs to exit, these threads will need to free their memories. Due to the global mmap_sem, the free has to be done one by one in serial mode. On large servers, due to the high number of CPU, the free can take more than 1 hour. To avoid this problem, limit the workingset by letting user to specify the size. The non-mt case does not need this but it doesn't hurt(the default size keeps the same as before if unit_size isn't specified). Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rwxr-xr-xcase-shm-pread-rand3
-rwxr-xr-xcase-shm-pread-rand-mt3
-rwxr-xr-xcase-shm-pread-seq3
-rwxr-xr-xcase-shm-pread-seq-mt3
4 files changed, 8 insertions, 4 deletions
diff --git a/case-shm-pread-rand b/case-shm-pread-rand
index c11eab5..ee61868 100755
--- a/case-shm-pread-rand
+++ b/case-shm-pread-rand
@@ -4,6 +4,7 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_task -f $SHM_FILE --readonly --random $((shm_size / 2))
+[ -n "$unit_size" ] || unit_size=$((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --readonly --random $unit_size
rm $SHM_FILE
diff --git a/case-shm-pread-rand-mt b/case-shm-pread-rand-mt
index ec9e8d6..4d3862e 100755
--- a/case-shm-pread-rand-mt
+++ b/case-shm-pread-rand-mt
@@ -4,6 +4,7 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_task -f $SHM_FILE --readonly --random $((shm_size / 2))
+[ -n "$unit_size" ] || unit_size=$((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --readonly --random $unit_size
rm $SHM_FILE
diff --git a/case-shm-pread-seq b/case-shm-pread-seq
index 0107693..8380551 100755
--- a/case-shm-pread-seq
+++ b/case-shm-pread-seq
@@ -4,6 +4,7 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_task -f $SHM_FILE --readonly $((shm_size / 2))
+[ -n "$unit_size" ] || unit_size=$((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --readonly $unit_size
rm $SHM_FILE
diff --git a/case-shm-pread-seq-mt b/case-shm-pread-seq-mt
index 8ce7f1f..3016dae 100755
--- a/case-shm-pread-seq-mt
+++ b/case-shm-pread-seq-mt
@@ -4,6 +4,7 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_task -f $SHM_FILE --readonly $((shm_size / 2))
+[ -n "$unit_size" ] || unit_size=$((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --readonly $unit_size
rm $SHM_FILE