summaryrefslogtreecommitdiffstats
path: root/scripts/zfs.sh
diff options
context:
space:
mode:
authorTony Nguyen <[email protected]>2018-12-07 11:51:42 -0700
committerBrian Behlendorf <[email protected]>2018-12-07 10:51:42 -0800
commitef57371a92367394108a5f65cee3c00d50101a4d (patch)
tree927a4ddf5fa30148054cecc691f9d5dd38d32864 /scripts/zfs.sh
parentd6496040d904c381d7ecdb113cfcab4964e033c1 (diff)
Do not enable stack tracer for ZFS performance test
Linux ZFS test suite runs with /proc/sys/kernel/stack_tracer_enabled=1, via zfs.sh script, which has negative performance impact, up to 40%. Since large stack is a rare issue now, preferred behavior would be: - making stack tracer an opt-in feature for zfs.sh - zfs-test.sh enables stack tracer only when requested Reviewed-by: George Melikov <[email protected]> Reviewed-by: Richard Elling <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> #8173
Diffstat (limited to 'scripts/zfs.sh')
-rwxr-xr-xscripts/zfs.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh
index d975eca97..015b3ba9d 100755
--- a/scripts/zfs.sh
+++ b/scripts/zfs.sh
@@ -14,6 +14,7 @@ fi
PROG=zfs.sh
VERBOSE="no"
UNLOAD="no"
+STACK_TRACER="no"
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
LDMOD=${LDMOD:-/sbin/modprobe}
@@ -33,7 +34,7 @@ KMOD_ZFS=${KMOD_ZFS:-zfs}
usage() {
cat << EOF
USAGE:
-$0 [hvud] [module-options]
+$0 [hvudS] [module-options]
DESCRIPTION:
Load/unload the ZFS module stack.
@@ -42,10 +43,11 @@ OPTIONS:
-h Show this message
-v Verbose
-u Unload modules
+ -S Enable kernel stack tracer
EOF
}
-while getopts 'hvu' OPTION; do
+while getopts 'hvuS' OPTION; do
case $OPTION in
h)
usage
@@ -57,6 +59,9 @@ while getopts 'hvu' OPTION; do
u)
UNLOAD="yes"
;;
+ S)
+ STACK_TRACER="yes"
+ ;;
?)
usage
exit
@@ -192,7 +197,7 @@ stack_clear() {
STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
STACK_TRACER_ENABLED=/proc/sys/kernel/stack_tracer_enabled
- if [ -e "$STACK_MAX_SIZE" ]; then
+ if [ "$STACK_TRACER" = "yes" ] && [ -e "$STACK_MAX_SIZE" ]; then
echo 1 >"$STACK_TRACER_ENABLED"
echo 0 >"$STACK_MAX_SIZE"
fi