From: Emoly Liu Date: Tue, 8 Jan 2013 08:29:15 +0000 (+0800) Subject: LU-958 tests: debug_mb set incorrectly for smp or vm X-Git-Tag: v1_8_9_WC1_RC1~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=74b46cfd1bb1cdca0e4e3aaaa780f5f8360b394b;p=fs%2Flustre-release.git LU-958 tests: debug_mb set incorrectly for smp or vm For cpus with number of cores or for some VMs, number of possible CPUs in the system could be greater than number of cpu reported by getconf. Added check for maximum debug buffer size. Added check if that "possible" exists, if not - use old method. The patch of LU-1249 is also invloved to auto correct improper debug buffer size setting. port of patch 2ccb34d882b01305794e7780b6dd691179ddae7e port of patch 28817cbd133c626042f9b142600c03187ba4a7ce Xyratex-bug-id: MRP-219 incorrect settings for debug_mb Test-Parameters: clientarch=x86_64 serverarch=x86_64 testlist=mmp Signed-off-by: Denis Kondratenko Signed-off-by: Bobi Jam Signed-off-by: Liu Ying Change-Id: Ib1e39a26e4d4af8e599d6e5fcdb1fecff8a6f4fa Reviewed-on: http://review.whamcloud.com/4962 Reviewed-by: Jian Yu Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lnet/libcfs/tracefile.c b/lnet/libcfs/tracefile.c index 81b2da1..ee87a0b 100644 --- a/lnet/libcfs/tracefile.c +++ b/lnet/libcfs/tracefile.c @@ -895,16 +895,17 @@ int trace_set_debug_mb(int mb) struct trace_cpu_data *tcd; if (mb < num_possible_cpus()) { - printk(KERN_ERR "Cannot set debug_mb to %d, " - "the value should be >= %d\n", - mb, num_possible_cpus()); - return -EINVAL; + printk(KERN_WARNING + "Lustre: %d MB is too small for debug buffer size, " + "setting it to %d MB.\n", mb, num_possible_cpus()); + mb = num_possible_cpus(); } if (mb > limit) { - printk(KERN_ERR "Lustre: Refusing to set debug buffer size to " - "%dMB - limit is %d\n", mb, limit); - return -EINVAL; + printk(KERN_WARNING + "Lustre: %d MB is too large for debug buffer size, " + "setting it to %d MB.\n", mb, limit); + mb = limit; } mb /= num_possible_cpus(); diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index 7792f18..70e370b 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -36,7 +36,16 @@ STRIPE_BYTES=${STRIPE_BYTES:-1048576} STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0} TIMEOUT=${TIMEOUT:-20} PTLDEBUG=${PTLDEBUG:-0x33f1504} -DEBUG_SIZE=${DEBUG_SIZE:-10} + +# promise 2MB for every cpu +if [ -f /sys/devices/system/cpu/possible ]; then + _debug_mb=$((($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)*2)) +else + _debug_mb=$(($(getconf _NPROCESSORS_CONF)*2)) +fi + +DEBUG_SIZE=${DEBUG_SIZE:-$_debug_mb} + SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff} L_GETGROUPS=${L_GETGROUPS:-`do_facet mds which l_getgroups || echo`} diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index ff118e1..267e33b 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -435,7 +435,12 @@ set_obdfilter_param() { set_debug_size () { local dz=${1:-$DEBUG_SIZE} - local cpus=$(getconf _NPROCESSORS_CONF) + + if [ -f /sys/devices/system/cpu/possible ]; then + local cpus=$(($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)) + else + local cpus=$(getconf _NPROCESSORS_CONF) + fi # bug 19944, adjust size to be -gt num_possible_cpus() # promise 2MB for every cpu at least