X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-benchmark.sh;h=398656ed4768393c9bedbf4d8a3c42cd8985a372;hb=6e6a3ac4ef3231463e05935ee68a1508b3a5d8d4;hp=d64ec234b6eb858bd49eae142b483f81eaf6e5ce;hpb=fa2b47dca628dd13df1bcc4166e9919a9b5fcb73;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index d64ec23..398656e 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -29,6 +29,7 @@ RSIZE=${RSIZE:-512} DEBUG_LVL=${DEBUG_LVL:-0} DEBUG_OFF=${DEBUG_OFF:-"eval lctl set_param debug=\"$DEBUG_LVL\""} DEBUG_ON=${DEBUG_ON:-"eval lctl set_param debug=0x33f0484"} +DIRECTIO=${DIRECTIO:-directio} PIOSBIN=${PIOSBIN:-$(which pios 2> /dev/null || true)} @@ -143,7 +144,7 @@ test_iozone() { # check if O_DIRECT support is implemented in kernel if [ -z "$O_DIRECT" ]; then touch $DIR/f.iozone - if ! ./directio write $DIR/f.iozone 0 1; then + if ! $DIRECTIO write $DIR/f.iozone 0 1; then log "SKIP iozone DIRECT IO test" O_DIRECT=no fi @@ -193,9 +194,11 @@ test_fsx() { FSX_SEED=${FSX_SEED:-$RANDOM} rm -f $testfile $LFS setstripe -c -1 $testfile - echo Using FSX_SEED=$FSX_SEED FSX_SIZE=$FSX_SIZE FSX_COUNT=$FSX_COUNT - fsx -c 50 -p 1000 -S $FSX_SEED -P $TMP -l $FSX_SIZE \ - -N $(($FSX_COUNT * 100)) $DIR/fsxfile + CMD="fsx -c 50 -p 1000 -S $FSX_SEED -P $TMP -l $FSX_SIZE \ + -N $((FSX_COUNT * 100)) $FSXOPT $testfile" + echo "Using: $CMD" + $CMD || error "fsx failed" + rm -f $testfile $DEBUG_ON } run_test fsx "fsx" @@ -231,33 +234,42 @@ pios_file_size () { } space_check () { - local testdir=$DIR/$tdir - local stripe=$($LFS getstripe -c $testdir) - - # if stripe_count = 1 the size should be less than min ost size, bug 24294 - local space=$($LFS df $testdir | grep "filesystem summary:" | awk '{print $3}') - [ $stripe -eq 1 ] && space=$(min_ost_size) - - local size=$(pios_file_size) - size=$(( size + size / 10 )) - # we can not use pios --cleanup|-x because we need the files exist for pios --verify, - # so, we need space available for each of pios_THREADCOUNT value run - local num_runs=$(echo ${pios_THREADCOUNT//,/ } | wc -w) - size=$(( size * $num_runs)) - space=$((space * 1024)) - echo size=$size space=$space - if [ $space -le $size ]; then - local ratio=$(( size / space + 1 )) - echo "Need free space atleast $size, available $space, ratio=$ratio" - local rgcount=$(( pios_REGIONCOUNT / ratio )) - echo "reducing pios_REGIONCOUNT=$pios_REGIONCOUNT on $ratio" - if [ $rgcount -eq 0 ]; then - echo "fs is too small, reduced pios_REGIONCOUNT=$rgcount" - return 10 - fi - pios_REGIONCOUNT=$(( pios_REGIONCOUNT / ratio )) - echo using pios_REGIONCOUNT=$pios_REGIONCOUNT size=$(pios_file_size) - fi + local testdir=$DIR/$tdir + local stripe=$($LFS getstripe -c $testdir) + local min_space_available=0 + + # if stripe_count = 1 the size should be less than min ost size, + # bug 24294 + min_space_available=$(lfs df | grep "^$FSNAME-OST" | \ + awk '{print $4}' | sort -un | head -1) + local space=$((min_space_available * OSTCOUNT)) + + [ $stripe -eq 1 ] && space=$(min_ost_size) + + local size=$(pios_file_size) + size=$(( size + size / 10 )) + # we can not use pios --cleanup|-x because we need the files exist for + # pios --verify, so, we need space available for each of + # pios_THREADCOUNT value run + local num_runs=$(echo ${pios_THREADCOUNT//,/ } | wc -w) + size=$(( size * $num_runs)) + space=$((space * 1024)) + echo size=$size space=$space + if [ $space -le $size ]; then + local ratio=$(( size / space + 1 )) + echo "Need free space atleast $size, \ + available $space, ratio=$ratio" + local rgcount=$(( pios_REGIONCOUNT / ratio )) + echo "reducing pios_REGIONCOUNT=$pios_REGIONCOUNT on $ratio" + if [ $rgcount -eq 0 ]; then + echo "fs is too small, \ + reduced pios_REGIONCOUNT=$rgcount" + return 10 + fi + pios_REGIONCOUNT=$(( pios_REGIONCOUNT / ratio )) + echo using pios_REGIONCOUNT=$pios_REGIONCOUNT \ + size=$(pios_file_size) + fi } pios_setup() { @@ -340,6 +352,6 @@ test_pios_fpp() { } run_test pios_fpp "pios file per process" -complete $(basename $0) $SECONDS +complete $SECONDS check_and_cleanup_lustre exit_status