local facet=$2
local parampat=$3
local opts=$4
+ local basethr=$5
local tmin
local tmin2
local tmax
local tstarted
local paramp
local msg="Insane $modname thread counts"
- local ncpts=$(check_cpt_number)
+ local ncpts=$(check_cpt_number $facet)
+ local nthrs
shift 4
setup
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 + ncpts))"
- do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmax - ncpts))"
+ 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 + $ncpts) && $tmax2 == ($tmax - $ncpts)))' || return $?
+ 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)
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
}
test_53a() {
- local ncpts=$(check_cpt_number)
- local nthrs
-
- nthrs=`expr 16 \* $ncpts`
- thread_sanity OST ost1 'ost.*.ost' 'oss_num_threads='$nthrs
+ thread_sanity OST ost1 'ost.*.ost' 'oss_num_threads' '16'
}
run_test 53a "check OSS thread count params"
test_53b() {
- local ncpts=$(check_cpt_number)
- local nthrs
-
- nthrs=`expr 16 \* $ncpts`
- thread_sanity MDT $SINGLEMDS 'mdt.*.*.' 'mdt_num_threads='$nthrs
+ thread_sanity MDT $SINGLEMDS 'mdt.*.*.' 'mdt_num_threads' '16'
}
run_test 53b "check MDT thread count params"
}
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