aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2022-03-03 19:13:06 +0800
committerWu Fengguang <wfg@mail.ustc.edu.cn>2022-03-03 19:13:06 +0800
commit08f498bb57615e594259a1fd870aca082908a452 (patch)
tree9134730310a6d84ed9de52d9246d5e2e4e044763
parent357b2e411fe5c03c81817aea9b321e1027f587fe (diff)
downloadvm-scalability-08f498bb57615e594259a1fd870aca082908a452.tar.gz
case-truncate: use cat for sparsefile to consume memory
The intent of "cp sparsefile /dev/null" is to fill page cache with sparsefile's content, but since cp will recognize the src file being sparse and skip doing any read of it but just writing zeros to /dev/null, it kind of failed the purpose. Fix this by using 'cat sparsefile > /dev/null'. Signed-off-by: Aaron Lu <aaron.lu@intel.com>
-rwxr-xr-xcase-truncate2
1 files changed, 1 insertions, 1 deletions
diff --git a/case-truncate b/case-truncate
index 7d75f7b..b72f012 100755
--- a/case-truncate
+++ b/case-truncate
@@ -8,7 +8,7 @@
for i in `seq $nr_task`
do
create_sparse_file $SPARSE_FILE-$i $((mem / nr_task))
- cp $SPARSE_FILE-$i /dev/null
+ cat $SPARSE_FILE-$i > /dev/null
done
t0=$(date +%s.%N)