From b201e30e5049a853c5750a0dcdc41b47851cbadf Mon Sep 17 00:00:00 2001 From: Denis Kondratenko Date: Fri, 10 Feb 2012 12:54:45 +0200 Subject: [PATCH] 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. Xyratex-bug-id: MRP-219 incorrect settings for debug_mb Reviewed-by: Andrew Perepechko Reviewed-by: Alexey Lyashko Signed-off-by: Denis Kondratenko Change-Id: I7001af7b1c88d5be056734d7d73a0263cca01627 Reviewed-on: http://review.whamcloud.com/1912 Reviewed-by: Andreas Dilger Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andrew Perepechko Reviewed-by: Oleg Drokin --- lustre/tests/cfg/local.sh | 15 ++++++++++++--- lustre/tests/test-framework.sh | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index e376160..8ae4e1f 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -44,10 +44,19 @@ STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0} SINGLEMDS=${SINGLEMDS:-"mds1"} TIMEOUT=${TIMEOUT:-20} PTLDEBUG=${PTLDEBUG:-0x33f0404} -DEBUG_SIZE=${DEBUG_SIZE:-10} -if [ `grep processor /proc/cpuinfo | wc -l` -gt 5 ]; then - DEBUG_SIZE=$((`grep processor /proc/cpuinfo | wc -l` * 2)) # promise 2MB for every cpu + +# promise 2MB for every cpu +_debug_mb=$((($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)*2)) + +# but not less then 10Mb, and limited by 512Mb in libcfs +if (( _debug_mb < 10 )); then + _debug_mb=10 +elif ((_debug_mb > 512 )); then + _debug_mb=512 fi + +DEBUG_SIZE=${DEBUG_SIZE:-$_debug_mb} + SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff} ENABLE_QUOTA=${ENABLE_QUOTA:-""} diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index b84d114..7985cad 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -573,7 +573,7 @@ ostdevlabel() { set_debug_size () { local dz=${1:-$DEBUG_SIZE} - local cpus=$(getconf _NPROCESSORS_CONF) + local cpus=$(($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)) # bug 19944, adjust size to be -gt num_possible_cpus() # promise 2MB for every cpu at least -- 1.8.3.1