sbi->ll_flags |= LL_SBI_CHECKSUM;
#endif
+#ifdef HAVE_LRU_RESIZE_SUPPORT
+ sbi->ll_flags |= LL_SBI_LRU_RESIZE;
+#endif
+
#ifdef HAVE_EXPORT___IGET
INIT_LIST_HEAD(&sbi->ll_deathrow);
spin_lock_init(&sbi->ll_deathrow_lock);
OBD_CONNECT_MDS_CAPA | OBD_CONNECT_OSS_CAPA |
OBD_CONNECT_CANCELSET;
#ifdef HAVE_LRU_RESIZE_SUPPORT
- data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
+ if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
+ data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
#endif
#ifdef CONFIG_FS_POSIX_ACL
data->ocd_connect_flags |= OBD_CONNECT_ACL;
*flags &= ~tmp;
goto next;
}
+ tmp = ll_set_opt("lruresize", s1, LL_SBI_LRU_RESIZE);
+ if (tmp) {
+ *flags |= tmp;
+ goto next;
+ }
+ tmp = ll_set_opt("nolruresize", s1, LL_SBI_LRU_RESIZE);
+ if (tmp) {
+ *flags &= ~tmp;
+ goto next;
+ }
LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n",
s1);
}
run_test 121 "read cancel race ========="
-test_124() {
+test_124a() {
[ -z "`grep lru_resize $LPROC/mdc/*/connect_flags`" ] && \
skip "no lru resize on server" && return 0
cancel_lru_locks mdc
log "unlink $NR files at $DIR/$tdir"
unlinkmany $DIR/$tdir/f $NR
}
-run_test 124 "lru resize ======================================="
+run_test 124a "lru resize ======================================="
+
+test_124b() {
+ [ -z "`grep lru_resize $LPROC/mdc/*/connect_flags`" ] && \
+ skip "no lru resize on server" && return 0
+ cleanup -f || error "failed to unmount"
+ MOUNTOPT="$MOUNTOPT,nolruresize"
+ setup
+
+ NR=3000
+ mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+
+ createmany -o $DIR/$tdir/f $NR
+ log "doing ls -la $DIR/$tdir 3 times (lru resize disabled)"
+ stime=`date +%s`
+ ls -la $DIR/$tdir > /dev/null
+ ls -la $DIR/$tdir > /dev/null
+ ls -la $DIR/$tdir > /dev/null
+ etime=`date +%s`
+ nolruresize_delta=$((etime-stime))
+ log "ls -la time: $nolruresize_delta seconds"
+
+ cleanup -f || error "failed to unmount"
+ MOUNTOPT=`echo $MOUNTOPT | sed "s/nolruresize/lruresize/"`
+ setup
+
+ createmany -o $DIR/$tdir/f $NR
+ log "doing ls -la $DIR/$tdir 3 times (lru resize enabled)"
+ stime=`date +%s`
+ ls -la $DIR/$tdir > /dev/null
+ ls -la $DIR/$tdir > /dev/null
+ ls -la $DIR/$tdir > /dev/null
+ etime=`date +%s`
+ lruresize_delta=$((etime-stime))
+ log "ls -la time: $lruresize_delta seconds"
+
+ if test $lruresize_delta -gt $nolruresize_delta; then
+ log "ls -la is $((lruresize_delta - $nolruresize_delta))s slower with lru resize enabled"
+ elif test $nolruresize_delta -gt $lruresize_delta; then
+ log "ls -la is $((nolruresize_delta - $lruresize_delta))s faster with lru resize enabled"
+ else
+ log "lru resize performs the same with no lru resize"
+ fi
+
+ unlinkmany $DIR/$tdir/f $NR
+}
+run_test 124b "lru resize (performance test) ======================="
test_125() { # 13358
mkdir -p $DIR/d125 || error "mkdir failed"