Whamcloud - gitweb
LU-17520 tests: change DEBUG_SIZE logic 88/53988/2
authorSergey Cheremencev <scherementsev@ddn.com>
Fri, 9 Feb 2024 17:22:07 +0000 (20:22 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:17:31 +0000 (07:17 +0000)
Don't set DEBUG_SIZE to 2MB*CPU_num. This way
lustre debug buffer could be just 4MB on a system
with 2 CPUs, despite 3GB RAM. It is the reason
why often time period in debug logs doesn't scope
the reason of failure(sometimes depending on debug
level logs it may store just several seconds). When
DEBUG_SIZE is not set, debug_mb would be calculated
inside libcfs based on RAM and CPU number.

Test-Parameters: trivial
Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: Iacccc625ec6564c982c75172561c8c3e4114e4b7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53988
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/cfg/local.sh
lustre/tests/test-framework.sh

index 07cf928..bf0a2bc 100644 (file)
@@ -99,17 +99,9 @@ DEF_STRIPE_COUNT=${DEF_STRIPE_COUNT:-} # filesystem default stripe count
 TIMEOUT=${TIMEOUT:-20}
 PTLDEBUG=${PTLDEBUG:-"vfstrace rpctrace dlmtrace neterror ha config \
                      ioctl super lfsck"}
+DEBUG_SIZE=${DEBUG_SIZE:-}
 SUBSYSTEM=${SUBSYSTEM:-"all"}
 
-# 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}
-
 TSTUSR=${TSTUSR:-"quota_usr"}
 TSTUSR2=${TSTUSR2:-"quota_2usr"}
 USER0=${USER0:-"sanityusr"}
index b4b0830..9e9ea07 100755 (executable)
@@ -1885,23 +1885,6 @@ set_osd_param() {
        do_nodes $nodes "$LCTL set_param -n osd-*.$device.$name=$value"
 }
 
-set_debug_size () {
-       local dz=${1:-$DEBUG_SIZE}
-
-       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 2>/dev/null)
-       fi
-
-       # bug 19944, adjust size to be -gt num_possible_cpus()
-       # promise 2MB for every cpu at least
-       if [ -n "$cpus" ] && [ $((cpus * 2)) -gt $dz ]; then
-               dz=$((cpus * 2))
-       fi
-       lctl set_param debug_mb=$dz
-}
-
 set_default_debug () {
        local debug=${1:-"$PTLDEBUG"}
        local subsys=${2:-"$SUBSYSTEM"}
@@ -1910,8 +1893,10 @@ set_default_debug () {
        [ -n "$debug" ] && lctl set_param debug="$debug" >/dev/null
        [ -n "$subsys" ] &&
                lctl set_param subsystem_debug="${subsys# }" >/dev/null
+       [ -n "$debug_size" ] &&
+               lctl set_param debug_mb="$debug_size" >/dev/null
 
-       [ -n "$debug_size" ] && set_debug_size $debug_size > /dev/null
+       return 0
 }
 
 set_default_debug_nodes () {