Whamcloud - gitweb
LU-7990 clio: revise readahead to support 16MB IO
[fs/lustre-release.git] / lustre / tests / sanity.sh
index cfe75cc..f52a1cc 100644 (file)
@@ -6596,6 +6596,65 @@ test_101f() {
 }
 run_test 101f "check mmap read performance"
 
+test_101g() {
+       local rpcs
+       local osts=$(get_facets OST)
+       local list=$(comma_list $(osts_nodes))
+       local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+
+       save_lustre_params $osts "obdfilter.*.brw_size" > $p
+
+       $LFS setstripe -c 1 $DIR/$tfile
+
+       if [ $(lustre_version_code ost1) -ge $(version_code 2.8.52) ]; then
+               set_osd_param $list '' brw_size 16M
+
+               echo "remount client to enable large RPC size"
+               remount_client $MOUNT || error "remount_client failed"
+
+               for mp in $($LCTL get_param -n osc.*.max_pages_per_rpc); do
+                       [ "$mp" -eq 4096 ] ||
+                               error "max_pages_per_rpc not correctly set"
+               done
+
+               $LCTL set_param -n osc.*.rpc_stats=0
+
+               # 10*16 MiB should be enough for the test
+               dd if=/dev/zero of=$DIR/$tfile bs=16M count=10
+               cancel_lru_locks osc
+               dd of=/dev/null if=$DIR/$tfile bs=16M count=10
+
+               # calculate 16 MiB RPCs
+               rpcs=$($LCTL get_param 'osc.*.rpc_stats' |
+                      sed -n '/pages per rpc/,/^$/p' |
+                      awk 'BEGIN { sum = 0 }; /4096:/ { sum += $2 };
+                           END { print sum }')
+               echo $rpcs RPCs
+               [ "$rpcs" -eq 10 ] || error "not all RPCs are 16 MiB BRW rpcs"
+       fi
+
+       echo "set RPC size to 4MB"
+
+       $LCTL set_param -n osc.*.max_pages_per_rpc=4M osc.*.rpc_stats=0
+       dd if=/dev/zero of=$DIR/$tfile bs=4M count=25
+       cancel_lru_locks osc
+       dd of=/dev/null if=$DIR/$tfile bs=4M count=25
+
+       # calculate 4 MiB RPCs
+       rpcs=$($LCTL get_param 'osc.*.rpc_stats' |
+               sed -n '/pages per rpc/,/^$/p' |
+               awk 'BEGIN { sum = 0 }; /1024:/ { sum += $2 };
+                    END { print sum }')
+       echo $rpcs RPCs
+       [ "$rpcs" -eq 25 ] || error "not all RPCs are 4 MiB BRW rpcs"
+
+       restore_lustre_params < $p
+       remount_client $MOUNT || error "remount_client failed"
+
+       rm -f $p $DIR/$tfile
+}
+run_test 101g "Big bulk(4/16 MiB) readahead"
+
 setup_test102() {
        test_mkdir -p $DIR/$tdir
        chown $RUNAS_ID $DIR/$tdir