### hackbench a general scheduler benchmark and stress test that is
### sensitive to regressions in the scheduler fast-path. It creates groups
### of threads or processes (depending on configuration) that communicate
### via pipes or sockets (depending on configuration).
###
### Note that while hackbench is often considered to be a scheduler benchmark,
### it is particularly weak when used with pipes. Given multiple senders and
### receivers sharing pipes that are unsynchronised, it is dominated heavily
### by a mutex protecting the pipe structures and a spinlock protecting the
### queue for wakeups. A significant percentage of time is spend acquiring
### and releasing those locks as well as the inevitable bounces of cache
### line data as waker/wakee processes do not run on the same CPUs but
### instead select CPUs that are nearby during wakeups.
###
### pipetest is a scheduler ping-pong test that measures context switch latency.

# MM Test Parameters
export MMTESTS="hackbench-process-pipes hackbench-process-sockets hackbench-thread-pipes hackbench-thread-sockets perfpipe"

# Test disk to setup (optional)
#export TESTDISK_RAID_DEVICES=
#export TESTDISK_RAID_MD_DEVICE=/dev/md0
#export TESTDISK_RAID_OFFSET=63
#export TESTDISK_RAID_SIZE=250019532
#export TESTDISK_RAID_TYPE=raid0
#export TESTDISK_PARTITION=/dev/sda6
#export TESTDISK_FILESYSTEM=ext3
#export TESTDISK_MKFS_PARAM="-f -d agcount=8"
#export TESTDISK_MOUNT_ARGS=""

# List of monitors
export RUN_MONITOR=yes
export MONITORS_ALWAYS=
export MONITORS_GZIP="proc-vmstat mpstat perf-time-stat"
export MONITORS_WITH_LATENCY="vmstat"
export MONITOR_PERF_EVENTS=cpu-migrations,context-switches
export MONITOR_UPDATE_FREQUENCY=10

# HackBench
export HACKBENCH_ITERATIONS=3
export HACKBENCH_MIN_GROUPS=1
export HACKBENCH_MAX_GROUPS=$((NUMCPUS*4))
if [[ `uname -m` =~ i.86 ]]; then
	export HACKBENCH_MAX_GROUPS=128
fi
if [ $HACKBENCH_MAX_GROUPS -gt 296 ]; then
	export HACKBENCH_MAX_GROUPS=296
fi
export HACKBENCH_LOOPS=10000
export MMTESTS_THREAD_CUTOFF=

# PipeTest
export PERFPIPE_ITERATIONS=30
export PERFPIPE_LOOPS=500000
