aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2022-03-03 19:13:18 +0800
committerWu Fengguang <wfg@mail.ustc.edu.cn>2022-03-03 19:13:18 +0800
commit6f4ef164eef69f2533dac9d56df469e61923f789 (patch)
treebedcea3fd4133196e6f80512dd2f14151328365d
parent08f498bb57615e594259a1fd870aca082908a452 (diff)
downloadvm-scalability-master.tar.gz
case-truncate-seq: truncate sequentiallyHEADmaster
Mel Gorman suggested LKP to cover a case where sparsefiles are removed sequentially so add a case based on case-truncate, which did the remove concurrently. In the meantime, this script will also report faultin time. Note the example script provided by Mel in the below link has a 'sync' after reading of the sparsefile and before removing of it. I failed to understand the intent of the 'sync' so I omitted. LINK: https://lore.kernel.org/linux-mm/20220217093113.GU3366@techsingularity.net/ Suggested-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Aaron Lu <aaron.lu@intel.com>
-rwxr-xr-xcase-truncate-seq21
1 files changed, 21 insertions, 0 deletions
diff --git a/case-truncate-seq b/case-truncate-seq
new file mode 100755
index 0000000..efa3a90
--- /dev/null
+++ b/case-truncate-seq
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# step 1) fill $mem with $nr_task files
+# step 2) truncate the files sequentially
+
+. ./hw_vars
+
+t0=$(date +%s.%N)
+for i in `seq $nr_task`
+do
+ create_sparse_file $SPARSE_FILE-$i $((mem / nr_task))
+ cat $SPARSE_FILE-$i > /dev/null
+done
+t1=$(date +%s.%N)
+echo $mem bytes faulted in $t1-$t0 seconds
+
+t0=$(date +%s.%N)
+rm $SPARSE_FILE-*
+t1=$(date +%s.%N)
+
+echo $mem bytes truncated in $t1-$t0 seconds