. ${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}
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
+add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype ldiskfs \
+ --reformat ${MDT_DEVNAME} $(mdsvdevname 1) > /dev/null || exit 2
scrub_attach() {
${ECHOCMD} "${LCTL} <<-EOF
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))
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) ---"
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
# cleanup the system at last
scrub_cleanup
-complete $(basename $0) $SECONDS
+complete $SECONDS
exit_status