Monday, September 13, 1993
-------------------------------------------------------------------------------
Multilevel feedback (MLF) queue scheduling
- Collection of schemes involving *multiple* ready queues
- Some policy for where processes enter, what level gets service when,
and whether processes can migrate among levels and how.
Questions to be answered (and book's example):
- How many different levels? (3 in book's example, named 0, 1, 2)
- Scheduling policy among queues? (0 is highest priority, 2 lowest.
Higher priority processes handled completely then next lower, etc.
Newly arrived process at a higher priority preempts lower priority
processes)
- Scheduling algorithm for each queue. Specify, for example, quantum size,
type of CPU scheduling policy (Queue 0: RR, quantum 8;
Queue 1: RR, quantum 16; Queue 2: RR, quantum infinity)
- Method used to determine when to upgrade process to higher priority
queue (Example: no upgrade)
- Method used to determine when to demote process to lower priority
queue (Example: when process uses up quantum, demote to next lowest
queue)
- Method used to determine which queue new process will enter when
that process needs service (Example: queue 0, the highest
priority queue)
-------------------------------------------------------------------------------
Second example, from Bic and Shaw:
- # priority levels: n+1, numbered 0 to n
- scheduling policy among levels: higher numbers have higher priority
(queue n highest and 0 lowest). All jobs at higher priority handled
before lower priorities
- scheduling algorithm for each queue: RR, global quantum of "q"
- upgrade: none
- demote: Each level has associated time Ti
Tn = mq (m is specified in specification; q quantum size)
n* terminal write > disk I/O completion
- when process awakened due to one of these events the
increment is added to the current process (with a
maximum possible curent priority of 15)
- process then enters appropriate level's queue
- process preempted after receiving fair share of CPU
then decrement priority by 1 (note that fair share
is defined for *process* not *level*, hence dispatcher
has more flexibility for handling individual
processes)
dispatch by current priority, so real time always has priority over
regular (must complete all real time that can run before any regular)
When does preemption occur?
- Real time: when (1) blocks itself (for I/O, e.g.); (2) higher priority
process arrives
- Regular: (1) and (2) plus (3) exceeds time quantum (at which point
process is demoted unless it is at base level already)
Note: similar to MLF but restriction of priority range (lower limit:
base priority; upper limit: 15 for regular). Also quantum associated
with process not with level (or global) so dispatcher can discriminate
among individual processes
*