X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fscrub-performance.sh;h=a43b860017868b08a4edc063656c52358951bf2b;hp=8c9b675b44c56af3ce2979d00dc8fded3448aa0a;hb=f13b2a4cea69d8c4c079d03d58f55d32a54a9679;hpb=7cecfcffae9737f929a2cbc8067e093a4f85c3ba diff --git a/lustre/tests/scrub-performance.sh b/lustre/tests/scrub-performance.sh index 8c9b675..a43b860 100644 --- a/lustre/tests/scrub-performance.sh +++ b/lustre/tests/scrub-performance.sh @@ -13,12 +13,16 @@ init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -[ "${MDSFSTYPE:-$FSTYPE}" != "ldiskfs" ] && +[ $(facet_fstype $SINGLEMDS) != ldiskfs ] && skip "OI scrub performance only for ldiskfs" && exit 0 +[[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.2.90) ]] && + skip "Need MDS version at least 2.2.90" && exit 0 require_dsh_mds || exit 0 +[ "$SLOW" = "no" ] && skip "skip scrub performance test under non-SLOW mode" + NTHREADS=${NTHREADS:-0} -UNIT=${UNIT:-0} +UNIT=${UNIT:-1048576} BACKUP=${BACKUP:-0} MINCOUNT=${MINCOUNT:-8192} MAXCOUNT=${MAXCOUNT:-32768} @@ -33,14 +37,14 @@ remote_mds && ECHOCMD=${RCMD} || ECHOCMD="eval" if [ ${NTHREADS} -eq 0 ]; then CPUCORE=$(${RCMD} cat /proc/cpuinfo | grep "processor.*:" | wc -l) - NTHREADS=$((CPUCORE * 3)) + NTHREADS=$((CPUCORE * 2)) fi stopall do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local -reformat_external_journal -add $SINGLEMDS $(mkfs_opts $SINGLEMDS) --backfstype ldiskfs --reformat \ - $MDT_DEVNAME > /dev/null || exit 2 +reformat_external_journal ${SINGLEMDS} +add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype ldiskfs \ + --reformat ${MDT_DEVNAME} $(mdsvdevname 1) > /dev/null || exit 2 scrub_attach() { ${ECHOCMD} "${LCTL} <<-EOF @@ -139,7 +143,8 @@ test_0() { if [ ${BACKUP} -ne 0 ]; then stime=$(date +%s) echo "backup/restore ${i} files start at: $(date)" - mds_backup_restore || error "Fail to backup/restore!" + mds_backup_restore $SINGLEMDS || + error "Fail to backup/restore!" echo "backup/restore ${i} files end at: $(date)" etime=$(date +%s) delta=$((etime - stime)) @@ -147,7 +152,8 @@ test_0() { echo "backup/restore ${i} files used ${delta} seconds" echo "backup/restore speed is $((i / delta))/sec" else - mds_remove_ois || error "Fail to remove/recreate!" + mds_remove_ois $SINGLEMDS || + error "Fail to remove/recreate!" fi echo "--- start to rebuild OI for $i files set at: $(date) ---" @@ -155,7 +161,7 @@ test_0() { error "Fail to start MDS!" while true; do - local STATUS=$($SHOW_SCRUB | \ + local STATUS=$($SHOW_SCRUB | awk '/^status/ { print $2 }') [ "$STATUS" == "completed" ] && break sleep 3 # check status every 3 seconds @@ -173,5 +179,5 @@ run_test 0 "OI scrub performance test" # cleanup the system at last scrub_cleanup -complete $(basename $0) $SECONDS +complete $SECONDS exit_status