From 28817cbd133c626042f9b142600c03187ba4a7ce Mon Sep 17 00:00:00 2001 From: Denis Kondratenko Date: Tue, 27 Mar 2012 10:47:51 +0300 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. Added check that "possible" is exist, if not - use old method. Xyratex-bug-id: MRP-219 incorrect settings for debug_mb Signed-off-by: Denis Kondratenko Change-Id: I1ea367d1b956ae1009c4a501e0f02b6c9209a2f7 Reviewed-on: http://review.whamcloud.com/2377 Reviewed-by: Yu Jian Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/cfg/local.sh | 6 +++++- lustre/tests/test-framework.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index 3f1d81f..47184c7 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -47,7 +47,11 @@ PTLDEBUG=${PTLDEBUG:-"vfstrace rpctrace dlmtrace neterror ha config ioctl super" SUBSYSTEM=${SUBSYSTEM:-"all -lnet -lnd -pinger"} # promise 2MB for every cpu -_debug_mb=$((($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)*2)) +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 # but not less then 10Mb, and limited by 512Mb in libcfs if (( _debug_mb < 10 )); then diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 880e55b..8ffc411 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -590,7 +590,12 @@ ostdevlabel() { set_debug_size () { local dz=${1:-$DEBUG_SIZE} - local cpus=$(($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)) + + 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 -- 1.8.3.1