diff options
| author | John Ogness <john.ogness@linutronix.de> | 2019-03-28 14:13:10 +0106 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2019-03-28 14:14:28 +0106 |
| commit | a39de4609225129c19df931d556b1d032d806403 (patch) | |
| tree | 6e83c9726da17c292e3107ae729b59eb557b018e | |
| parent | 0b94092f4d96f0c48f24272641af171fc8065515 (diff) | |
schulung_tools: add scheduling tests
This is a set of tests to compare the scheduling using various
policies and priorities.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
| -rw-r--r-- | schulung_tools/scheduling_tests/README | 33 | ||||
| -rwxr-xr-x | schulung_tools/scheduling_tests/busy.sh | 13 |
2 files changed, 46 insertions, 0 deletions
diff --git a/schulung_tools/scheduling_tests/README b/schulung_tools/scheduling_tests/README new file mode 100644 index 0000000..cf6c601 --- /dev/null +++ b/schulung_tools/scheduling_tests/README @@ -0,0 +1,33 @@ +# restrict current shell to CPU0 for tests +# (the busy.sh script restricts tests to CPU1) +taskset -p 1 $$ > /dev/null + +echo 'default vs. max unnice (unnice wins)' +sudo ./busy.sh task1_other_default & \ + sudo nice -n -20 ./busy.sh task2_other_nice-20 +wait + +echo 'max unnice vs. FIFO (FIFO wins)' +sudo chrt -f 1 ./busy.sh task1_fifo_prio1 & \ + sudo nice -n -20 ./busy.sh task2_other_nice-20 +wait + +echo 'FIFO vs. FIFO (first FIFO wins)' +sudo chrt -f 1 ./busy.sh task1_fifo_prio1 & \ + sudo chrt -f 1 ./busy.sh task2_fifo_prio1 +wait + +echo 'FIFO prio 1 vs FIFO prio 2 (prio 2 wins)' +sudo chrt -f 1 ./busy.sh task1_fifo_prio1 & \ + sudo chrt -f 2 ./busy.sh task2_fifo_prio2 +wait + +echo 'RoundRobin vs RoundRobin (tie)' +sudo chrt -r 1 ./busy.sh task1_roundrobin_prio1 & \ + sudo chrt -r 1 ./busy.sh task2_roundrobin_prio1 +wait + +echo 'RoundRobin prio 1 vs RoundRobin prio 2 (prio 2 wins)' +sudo chrt -r 1 ./busy.sh task1_roundrobin_prio1 & \ + sudo chrt -r 2 ./busy.sh task2_roundrobin_prio2 +wait diff --git a/schulung_tools/scheduling_tests/busy.sh b/schulung_tools/scheduling_tests/busy.sh new file mode 100755 index 0000000..06630d0 --- /dev/null +++ b/schulung_tools/scheduling_tests/busy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# pin ourself to CPU1 +taskset -p 2 $$ > /dev/null + +echo "`date +%s`: begin $1" + +ct=1 +while [ $ct -lt 1000000 ]; do + ct=$(($ct + 1)) +done + +echo "`date +%s`: end $1" |
