Main idea
- assume a new job might be a short one and give it high priority.
- If it indeed short, then no worries
- If not, it will slowly move down the queues
- This way MLFQ approximates SJF
Prashanth L.A.
2023-08-22
Multi-Level Feedback Queue (MLFQ)
To optimize turnaround time, run shorter jobs first Â
to make system feel responsive to interactive users, use time slice scheduling Â
Â
Rule | Description |
---|---|
Rule 1 | If Priority(A) \(>\) Priority(B), A runs |
Rule 2 | If Priority(A) \(=\) Priority(B), A and B run in RR |
Rule | Description |
---|---|
Rule 3 | When a job enters the system, it is placed at the highest priority |
Rule 4a | If a job uses up an entire time slice while running, its priority is reduced |
Rule 4b | If a job gives up the CPU before the time slice is up, it stays at the same priority level |
Enter at highest priority and then go down
Too many interactive jobs consuming all CPU time. Long running jobs don’t ever run
Rule | Description |
---|---|
Rule 5 | After some time period \(S\), move all the jobs to the topmost queue |
Â
Rule | Description |
---|---|
Rule 4 | Once a job uses up its time allotment at a given level (regardless of how many times it has given up the CPU), its priority is reduced |
Regardless of the I/O behavior of the process, it slowly moves down the queues \(\Rightarrow\) cannot gain an unfair CPU share
No easy answers, try different workloads to tune MLFQ
Rule | Description |
---|---|
Rule 1 | If Priority(A) \(>\) Priority(B), A runs |
Rule 2 | If Priority(A) \(=\) Priority(B), A and B run in RR. |
Rule 3. | When a job enters the system, it is placed at the highest priority |
Rule 4 | Once a job uses up its time allotment at a given level, its priority is reduced |
Rule 5 | After some time period \(S\), move all the jobs to the topmost queue |