Hi, I wrote a small test program to play around with SCHED_DEADLINE which triggered various PI related crashes. Steven convinced me to get the test somehow upstream. I figured pi_stress is very simular with my test program. So here my attempt to merge the essence of my test into pi_stress.c patch 1: hackbench: Don't re-assign context for each fd patch 2: rt-tests.h: Remove unused header file patch 3: pi_stress: Remove unused TIMER_SIGNAL definition Not really related to this series. Just found it while browsing the code a bit. Are you interested in such patches? patch 4: error: Add debug() function patch 5: pi_stress: Use error.h for logging and debugging I didn't want to add the sched_setattr() code directly to pi_stress.c. As soon rt-utils.h is used you get also error.h which brings info() and friends it collides in pi_stress.c. Several other tests also implement info() and friends. Would it make sense to convert them using error.h too? Then I would also suggest to get --verbose and --debug options handled in a central way. Maybe something like the GLib does with parsing the argc first and hanlding those flags. What do you think? patch 6: rt-sched: Add sched_setattr/sched_getattr API patch 7: rt-utils: Add helper to parse/print scheduling policies patch 8: rt-utils: Add gettid() Add to the library some of the code which could be reused by other tests as well. Nothing really fancy. patch 9: pi_stress: Store schedule attributes per thread Finally this adds the a command line arguments which allows the user to define which scheduler setting is used for each thread catagory: # ./pi_stress --sched id=high,policy=deadline,runtime=100000,deadline=200000,period=200000 Starting PI Stress Test Number of thread groups: 1 Duration of test run: infinite Number of inversions per group: unlimited Admin thread SCHED_FIFO priority 4 1 groups of 3 threads will be created High thread SCHED_DEADLINE runtime 100000 deadline 200000 period 200000 Med thread SCHED_FIFO priority 2 Low thread SCHED_FIFO priority 1 Current Inversions: 2446249 Stopping test Terminated WARNING: Do no run this on older kernels (<3.18-rc3) it will crash your system. You have been warned! Obviously, you can also do some stupid stuff like: # ./pi_stress --rr --sched id=high,policy=deadline,h=dl,runtime=100000,deadline=200000,period=200000 --sched id=low,policy=fifo,priority=3 Starting PI Stress Test Number of thread groups: 1 Duration of test run: infinite Number of inversions per group: unlimited Admin thread SCHED_RR priority 4 1 groups of 3 threads will be created High thread SCHED_DEADLINE runtime 100000 deadline 200000 period 200000 Med thread SCHED_RR priority 2 Low thread SCHED_FIFO priority 3 Current Inversions: 352306 Stopping test Terminated cheers, daniel Cc: Clark Williams <williams@xxxxxxxxxx> Cc: John Kacur <jkacur@xxxxxxxxxx> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> Cc: Dario Faggioli <raistlin@xxxxxxxx> Cc: <linux-rt-users@xxxxxxxxxxxxxxx> Daniel Wagner (9): hackbench: Don't re-assign context for each fd rt-tests.h: Remove unused header file pi_stress: Remove unused TIMER_SIGNAL definition error: Add debug() function pi_stress: Use error.h for logging and debugging rt-sched: Add sched_setattr/sched_getattr API rt-utils: Add helper to parse/print scheduling policies rt-utils: Add gettid() pi_stress: Store schedule attributes per thread Makefile | 4 +- src/hackbench/hackbench.c | 8 +- src/include/error.h | 1 + src/include/rt-sched.h | 76 +++++++ src/include/rt-tests.h | 124 ------------ src/include/rt-utils.h | 7 + src/lib/error.c | 10 + src/lib/rt-sched.c | 43 ++++ src/lib/rt-utils.c | 44 ++++ src/pi_tests/pi_stress.c | 500 ++++++++++++++++++++++++++++++---------------- 10 files changed, 512 insertions(+), 305 deletions(-) create mode 100644 src/include/rt-sched.h delete mode 100644 src/include/rt-tests.h create mode 100644 src/lib/rt-sched.c -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html