Whamcloud - gitweb
LU-8641 tests: tests: speedup metabench 52/22852/2
authorElena Gryaznova <elena.gryaznova@seagate.com>
Fri, 30 Sep 2016 18:15:57 +0000 (21:15 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 23 Apr 2017 03:11:03 +0000 (03:11 +0000)
With huge number of nfiles created by metabench
rm -rf called at the end of run_metabench() takes a very long
time.
Sine metabench cleanup is also very slow, metabench
execution without -k option is useless to use also.
Patch adds mbench_CLEANUP mode, default value is true.
When set to false -- metabench testdir is just renamed to avoid
files/dirs deletion.

Seagate-bug-id: MRP-3454
Signed-off-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Change-Id: Iaa130785d27dc3a87f642723fcaad6dc5e748440
Reviewed-on: https://review.whamcloud.com/22852
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/functions.sh

index cada840..7e8af72 100644 (file)
@@ -343,6 +343,7 @@ run_metabench() {
     # threads per client
     mbench_THREADS=${mbench_THREADS:-4}
        mbench_OPTIONS=${mbench_OPTIONS:-}
+       mbench_CLEANUP=${mbench_CLEANUP:-true}
 
     [ x$METABENCH = x ] &&
         { skip_env "metabench not found" && return; }
@@ -357,12 +358,12 @@ run_metabench() {
     # mpi_run uses mpiuser
     chmod 0777 $testdir
 
-    # -C             Run the file creation tests.
-    # -S             Run the file stat tests.
-    # -c nfile       Number of files to be used in each test.
-    # -k             Cleanup.  Remove the test directories.
+       # -C             Run the file creation tests.
+       # -S             Run the file stat tests.
+       # -c nfile       Number of files to be used in each test.
+       # -k             => dont cleanup files when finished.
        local cmd="$METABENCH -w $testdir -c $mbench_NFILES -C -S -k $mbench_OPTIONS"
-    echo "+ $cmd"
+       echo "+ $cmd"
 
        # find out if we need to use srun by checking $SRUN_PARTITION
        if [ "$SRUN_PARTITION" ]; then
@@ -378,7 +379,12 @@ run_metabench() {
     if [ $rc != 0 ] ; then
         error "metabench failed! $rc"
     fi
-    rm -rf $testdir
+
+       if $mbench_CLEANUP; then
+               rm -rf $testdir
+       else
+               mv $dir/d0.metabench $dir/_xxx.$(date +%s).d0.metabench
+       fi
 }
 
 run_simul() {