Like I previously said, there are 4 process priorities, each with a dedicated queue. A queue contains n “Ready State” processes of priority x.
#sh processes
PID     QTy PC          Runtime (ms) Invoked uSecs      Stacks          TTY     Process
22      Mwe 628250A4    0               1       0       2516/3000       0       RMI RM Notify Wa
23      Hwe 60092C38    0               2       0       5508/6000       0       SMART
24      Msp 612FAFB0    76              170778  0       5540/6000       0       GraphIt
25      Mwe 613B193C    0               2       0       11504/12000     0       Dialer event
26      Mwe 624E81B0    0               1       0       5540/6000       0       SERIAL A'detect
27      Mwe 62AC6984    0               2       0       11516/12000     0       XML Proxy Client
28      M*      0       456             153298  0       9356/12000      194     SSH Process
29      Mwe 602AFC70    0               1       0       2484/3000       0       Inode Table Dest
30      Cwe 62818F90    0               1       0       5548/6000       0       Critical Bkgnd
31      Mwe 6033D7D8    96              102962  0       10208/12000     0       Net Background
32      Mwe 6033DA68    0               2       0       11420/12000     0       IDB Work
33      Lwe 6128EEEC    2184            9209    237     10088/12000     0       Logger
In this “show processes” output, we can see the 4 priorities and a Running State process. Within Q Column:
  • L : Low Priority (background process)
  • M : Medium Priority (default priority)
  • H : High Priority (Process processing received packets)
  • C : Critical Priority (Resources allocation, core system processes)
  • K : Killed
  • D : Crashed
  • X : Corrupted
Within Ty Column:
  • * : Running State Process
  • S : Process that called Suspend
  • E : Process waiting for events
  • rd : Ready State Process
  • we : Idle State Process waiting on events
  • sa : Idle State Process waiting on specific time
  • si : Idle State Process waiting on end of interval
  • sp : Idle State Process waiting on periodic interval
  • st : Idle State Process waiting on timer expiration
  • hg : Hang Process
  • xx : Dead Process
Other columns:
  • PID : Process ID …
  • PC : Process current code Stack Pointer (0 = running)
  • Runtime : Total amount of CPU time used since process creation
  • Invoked : Number of time process was Invoked
  • uSec : Average CPU time spent during each invoke
  • Stacks : Current process stack use/Total process stack use
  • TTY: Has process access to STDIN/STDOUT, if !0, points to specified TTY/VTY (#show line).
#show line
Tty     Line    Typ Tx/Rx       A Modem Roty AccO AccI  Uses    Noise Overruns    Int
0       0       CTY             -     -          -       -      -       0       0       0/0     -
1       1       AUX 9600/9600   -     -          -       -      -       0       0       0/0     -
*194    194     VTY             -     -          -       -      -       3       0       0/0     -
195     195     VTY             -     -          -       -      -       0       0       0/0     -
196     196     VTY             -     -          -       -      -       0       0       0/0     -
  • Process : Process name
Let’s go back to the Scheduler: image 1. The Scheduler starts with Critical Priority Stack and runs then removes all processes within. 2. If the Critical Stack is empty, the Scheduler moves on to High Priority Stack and runs then removes the first process. Once the first process was run, the scheduler checks that the Critical Stack is still empty. If it’s not, the Scheduler runs then removes all processes within it. The Scheduler moves on to the next High Priority Process. After each High Priority Process, the Scheduler checks if there is a higher priority process (Critical). If so, it runs then removes it. 3. If both Critical Stack and High Priority Stack are empty, the Scheduler moves on to Medium Priority Stack. Between each Medium Priority Process, the scheduler checks if there are any High Priority Processes to run. If there are, it runs the first one and removes it, then checks if there are any Critical Processes to run and runs then removes all of them. When the Critical stack is empty, the scheduler moves on to the next High Priority Process, and so on … 4. If the Critical/High/Medium Priority stacks are empty, the scheduler moves on to the Low Priority Stack. (If we are coming from the Medium Priority Stack, we do not move on to the Low Priority Stack. At the end of the Medium Priority Stack, we move on to Critical Priority Stack. When we’ve executed this step 15 times, we finally move to Low Priority Stack). Between each Low Priority Process, the scheduler checks if there are any Medium Priority Process to run. If there are, it runs and removes each Medium Priority Process but between each of them the scheduler checks if there are any High Priority Process to run. If there are, it runs then removes it, but between every High Priority Process, it checks if there are any Critical processes to run, to run and remove them all. 5. It goes back to step 1. If a process forgets to release the CPU within 4sec, no worry! The WatchDog Timer will kill it! The WatchDog Timer is refreshed by an Interrupt (every 4msec by the System Timer). The Incoming Packet Notification is also done using an Interrupt. So the IOS can instantaneously process the incoming packet. I will talk about the Packet Switching Methods soon. Next Post: IOS uses of the Memory