1The following is a demonstration of the priclass.d script. 2 3 4The script was run for several seconds then Ctrl-C was hit. During 5this time, other processes in different scheduling classes were 6running. 7 8 # ./priclass.d 9 Sampling... Hit Ctrl-C to end. 10 ^C 11 12 IA 13 value ------------- Distribution ------------- count 14 40 | 0 15 50 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 30 16 60 | 0 17 18 SYS 19 value ------------- Distribution ------------- count 20 < 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4959 21 0 | 0 22 10 | 0 23 20 | 0 24 30 | 0 25 40 | 0 26 50 | 0 27 60 | 30 28 70 | 0 29 80 | 0 30 90 | 0 31 100 | 0 32 110 | 0 33 120 | 0 34 130 | 0 35 140 | 0 36 150 | 0 37 160 | 50 38 >= 170 | 0 39 40 RT 41 value ------------- Distribution ------------- count 42 90 | 0 43 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 110 44 110 | 0 45 46 TS 47 value ------------- Distribution ------------- count 48 < 0 | 0 49 0 |@@@@@@@@@@@@@@@ 2880 50 10 |@@@@@@@ 1280 51 20 |@@@@@ 990 52 30 |@@@@@ 920 53 40 |@@@@ 670 54 50 |@@@@ 730 55 60 | 0 56 57The output is quite interesting, and illustrates neatly the behaviour 58of different scheduling classes. 59 60The IA interactive class had 30 samples of a 50 to 59 priority, a fairly 61high priority. This class is used for interactive processes, such as 62the windowing system. I had clicked on a few windows to create this 63activity. 64 65The SYS system class has had 4959 samples at a < 0 priority - the lowest, 66which was for the idle thread. There are a few samples at higher 67priorities, including some in the 160 to 169 range (the highest), which 68are for interrupt threads. The system class is used by the kernel. 69 70The RT real time class had 110 samples in the 100 to 109 priority range. 71This class is designed for real-time applications, those that must have 72a consistant response time regardless of other process activity. For that 73reason, the RT class trumps both TS and IA. I created these events by 74running "prstat -R" as root, which runs prstat in the real time class. 75 76The TS time sharing class is the default scheduling class for the processes 77on a Solaris system. I ran an infinite shell loop to create heavy activity, 78"while :; do :; done", which shows a profile that leans towards lower 79priorities. This is deliberate behaivour from the time sharing class, which 80reduces the priority of CPU bound processes so that they interefere less 81with I/O bound processes. The result is more samples in the lower priority 82ranges. 83