| 1 |
DESCRIPTION |
| 2 |
|
| 3 |
The pi_stress program is a stress test that is intended to exercise |
| 4 |
kernel and C library code paths for POSIX mutexes using the Priority |
| 5 |
Inheritance attribute (PTHREAD_PRIO_INHERIT). |
| 6 |
|
| 7 |
The program consists of an admin thread (main), a reporter thread and |
| 8 |
some number of groups of three threads called "inversion |
| 9 |
groups". These thread groups are called that because they cause a |
| 10 |
condition called Priority Inversion, where a high priority thread is |
| 11 |
blocked due to a low-priority thread holding a shared |
| 12 |
resource. Priority inversion with no contravening logic is a deadlock |
| 13 |
condition. |
| 14 |
|
| 15 |
Each inversion group consists of three threads: |
| 16 |
|
| 17 |
1. A high-priority thread |
| 18 |
2. A medium-priority thread |
| 19 |
3. A low-priority thread |
| 20 |
|
| 21 |
The threads run through a state machine designed to guarantee that a |
| 22 |
low-priority thread holds a mutex while a medium priority thread runs |
| 23 |
(keeping the low-priority thread from releasing the mutex). The |
| 24 |
high-priority thread attempts to acquire the mutex and is blocked |
| 25 |
because of the low-priority thread holding it. If priority inheritence |
| 26 |
is working, the low-priority thread will receive a priority boost |
| 27 |
(will inherit the high-priority thread's priority) and will then run |
| 28 |
and release the mutex, averting a deadlock. |
| 29 |
|
| 30 |
On a multi-processor system, the admin and reporter threads are run |
| 31 |
one one processor while the inversion groups are run on another |
| 32 |
processor. |
| 33 |
|
| 34 |
|
| 35 |
STEPS TO RUN |
| 36 |
|
| 37 |
Install the pi_tests rpm. If you are running Fedora Core, the simplest |
| 38 |
way do to that is to fetchthe rt-userspace.repo file from: |
| 39 |
|
| 40 |
http://people.redhat.com/~williams/rt-userspace.repo |
| 41 |
|
| 42 |
and install that file in /etc/yum.repos.d, then run: |
| 43 |
|
| 44 |
$ yum install pi_stress |
| 45 |
|
| 46 |
If you are not running Fedora, you can fetch the SRPM and build it, or |
| 47 |
fetch the tarball from: |
| 48 |
|
| 49 |
http://people.redhat.com/~williams/tests |
| 50 |
|
| 51 |
Once you've installed it, to see the options provided by pi_stress you |
| 52 |
can run it with the --help option to get a usage message or read the |
| 53 |
man page for more detail. |
| 54 |
|
| 55 |
Since the stress test runs as a number of realtime threads, it's |
| 56 |
usually a good idea to run the test while logged into the test machine |
| 57 |
from another system. Its always a good idea to have a window up |
| 58 |
that's either a serial console to the test machine or something that's |
| 59 |
continually printing the contents of the test system's syslog |
| 60 |
(e.g. 'tail -f /var/log/messages'). |
| 61 |
|
| 62 |
Login to the test machine and run pi_stress as root: |
| 63 |
|
| 64 |
$ sudo /usr/sbin/pi_stress |
| 65 |
|
| 66 |
This will run the test with the defaults of: |
| 67 |
|
| 68 |
- no stop time |
| 69 |
- 10 inversion groups |
| 70 |
|
| 71 |
A banner will be printed indicating what defaults are in use and then |
| 72 |
a display will be updated showing the current number of inversions |
| 73 |
that have been performed. To stop the test, press any key and a |
| 74 |
summary will be printed to show how many inversions were performed and |
| 75 |
how long the test ran. |
| 76 |
|
| 77 |
To run the test for a specifed time, use the --duraton=<seconds> |
| 78 |
option. |
| 79 |
|
| 80 |
|