Whamcloud - gitweb
LU-1668 tests: fix for conf-sanity 53_a & 53_b
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 701e58a..e5dbb41 100644 (file)
@@ -2547,6 +2547,7 @@ thread_sanity() {
         local facet=$2
         local parampat=$3
         local opts=$4
+       local basethr=$5
         local tmin
         local tmin2
         local tmax
@@ -2554,6 +2555,8 @@ thread_sanity() {
         local tstarted
         local paramp
         local msg="Insane $modname thread counts"
+       local ncpts=$(check_cpt_number $facet)
+       local nthrs
         shift 4
 
         setup
@@ -2575,13 +2578,23 @@ thread_sanity() {
         tstarted=$(do_facet $facet "lctl get_param -n ${paramp}.threads_started" || echo 0)
         lassert 23 "$msg (PDSH problems?)" '(($tstarted && $tmin && $tmax))' || return $?
         lassert 24 "$msg" '(($tstarted >= $tmin && $tstarted <= $tmax ))' || return $?
+       nthrs=$(expr $tmax - $tmin)
+       if [ $nthrs -lt $ncpts ]; then
+               nthrs=0
+       else
+               nthrs=$ncpts
+       fi
+
+       [ $tmin -eq $tmax -a $tmin -eq $tstarted ] &&
+               skip_env "module parameter forced $facet thread count" &&
+               tmin=3 && tmax=$((3 * tmax))
 
         # Check that we can change min/max
-        do_facet $facet "lctl set_param ${paramp}.threads_min=$((tmin + 1))"
-        do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmax - 1))"
-        tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
-        tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
-        lassert 25 "$msg" '(($tmin2 == ($tmin + 1) && $tmax2 == ($tmax -1)))' || return $?
+       do_facet $facet "lctl set_param ${paramp}.threads_min=$((tmin + nthrs))"
+       do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmax - nthrs))"
+       tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
+       tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
+       lassert 25 "$msg" '(($tmin2 == ($tmin + $nthrs) && $tmax2 == ($tmax - $nthrs)))' || return $?
 
         # Check that we can set min/max to the same value
         tmin=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
@@ -2601,7 +2614,8 @@ thread_sanity() {
         LOAD_MODULES_REMOTE=true
         cleanup
         local oldvalue
-        setmodopts -a $modname "$opts" oldvalue
+       local newvalue="${opts}=$(expr $basethr \* $ncpts)"
+       setmodopts -a $modname "$newvalue" oldvalue
 
         load_modules
         setup
@@ -2626,12 +2640,12 @@ thread_sanity() {
 }
 
 test_53a() {
-        thread_sanity OST ost1 'ost.*.ost' 'oss_num_threads=64'
+       thread_sanity OST ost1 'ost.*.ost' 'oss_num_threads' '16'
 }
 run_test 53a "check OSS thread count params"
 
 test_53b() {
-        thread_sanity MDT $SINGLEMDS 'mdt.*.*.' 'mdt_num_threads=64'
+       thread_sanity MDT $SINGLEMDS 'mdt.*.*.' 'mdt_num_threads' '16'
 }
 run_test 53b "check MDT thread count params"
 
@@ -2896,6 +2910,26 @@ test_62() {
 }
 run_test 62 "start with disabled journal"
 
+test_63() {
+       if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
+               skip "Only applicable to ldiskfs-based MDTs"
+               return
+       fi
+
+       local inode_slab=$(do_facet $SINGLEMDS \
+               "awk '/ldiskfs_inode_cache/ { print \\\$5 }' /proc/slabinfo")
+       if [ -z "$inode_slab" ]; then
+               skip "ldiskfs module has not been loaded"
+               return
+       fi
+
+       echo "$inode_slab ldisk inodes per page"
+       [ "$inode_slab" -ge "3" ] ||
+               error "ldisk inode size is too big, $inode_slab objs per page"
+       return
+}
+run_test 63 "Verify each page can at least hold 3 ldisk inodes"
+
 if ! combined_mgs_mds ; then
        stop mgs
 fi