X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fscrub-performance.sh;h=f04e08c78332531815ad2a370bcbb24e33830620;hb=9b8e8e0e54e5055c02469cb16d186c94fa2040e0;hp=0c029e7779511bcfbcb25e4c09ba0edec41be8ae;hpb=dee5f24114531ec34fc56ce2826ada9e5690aabc;p=fs%2Flustre-release.git diff --git a/lustre/tests/scrub-performance.sh b/lustre/tests/scrub-performance.sh index 0c029e7..f04e08c 100644 --- a/lustre/tests/scrub-performance.sh +++ b/lustre/tests/scrub-performance.sh @@ -13,14 +13,17 @@ init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging +[ "$SLOW" = "no" ] && + skip "skip scrub performance test under non-SLOW mode" && exit 0 + [ $(facet_fstype $SINGLEMDS) != ldiskfs ] && - skip "OI scrub performance only for ldiskfs" && exit 0 + skip "ldiskfs only test" && 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 NTHREADS=${NTHREADS:-0} -UNIT=${UNIT:-0} +UNIT=${UNIT:-1048576} BACKUP=${BACKUP:-0} MINCOUNT=${MINCOUNT:-8192} MAXCOUNT=${MAXCOUNT:-32768} @@ -35,14 +38,25 @@ 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 + +cleanupall + +if ! combined_mgs_mds ; then + do_rpc_nodes $(facet_active_host mgs) load_modules_local + add mgs $(mkfs_opts mgs $(mgsdevname)) --backfstype ldiskfs \ + --reformat $(mgsdevname) $(mgsvdevname) ${quiet:+>/dev/null} || + exit 1 + + start mgs $(mgsdevname) $MGS_MOUNT_OPTS || error "Fail to start MGS!" 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) ${quiet:+>/dev/null} || + exit 2 scrub_attach() { ${ECHOCMD} "${LCTL} <<-EOF @@ -83,8 +97,12 @@ scrub_create() { } scrub_cleanup() { + cleanupall do_rpc_nodes $(facet_active_host $SINGLEMDS) unload_modules - formatall + if ! combined_mgs_mds ; then + do_rpc_nodes $(facet_active_host mgs) unload_modules + fi + REFORMAT="yes" cleanup_and_setup_lustre } scrub_create_nfiles() { @@ -141,7 +159,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)) @@ -149,7 +168,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) ---" @@ -176,4 +196,5 @@ run_test 0 "OI scrub performance test" # cleanup the system at last scrub_cleanup complete $SECONDS +check_and_cleanup_lustre exit_status