8: Scheduling: The Multi-Level Feedback Queue
Operating System: Three Easy Pieces
1 Youjip Won
The Multi-Level Feedback Queue Operating System: Three Easy Pieces - - PowerPoint PPT Presentation
8: Scheduling: The Multi-Level Feedback Queue Operating System: Three Easy Pieces 1 Youjip Won Multi-Level Feedback Queue (MLFQ) A Scheduler that learns from the past to predict the future. Objective: Optimize turnaround time
Operating System: Three Easy Pieces
1 Youjip Won
A Scheduler that learns from the past to predict the future. Objective:
2 Youjip Won
MLFQ has a number of distinct queues.
A job that is ready to run is on a single queue.
3 Youjip Won
MLFQ varies the priority of a job based on its observed behavior. Example:
4 Youjip Won
5 Youjip Won
MLFQ priority adjustment algorithm:
6 Youjip Won
A three-queue scheduler with time slice 10ms
7 Youjip Won
50 100 150 200
Long-running Job Over Time (msec)
Assumption:
8 Youjip Won
Along Came An Interactive Job (msec)
50 100 150 200
Assumption:
9 Youjip Won
A Mixed I/O-intensive and CPU-intensive Workload (msec)
50 100 150 200
The MLFQ approach keeps an interactive job at the highest priority
Starvation
Game the scheduler
A program may change its behavior over time.
10 Youjip Won
Rule 5: After some time period S, move all the jobs in the system to
A long-running job(A) with two short-running interactive job(B, C) 11 Youjip Won
50 100 150 200
50 100 150 200
Without(Left) and With(Right) Priority Boost
How to prevent gaming of our scheduler? Solution:
12 Youjip Won
50 100 150 200
50 100 150 200
Without(Left) and With(Right) Gaming Tolerance
E.g., 10 or fewer milliseconds
E.g., 100 milliseconds 13 Youjip Won
50 100 150 200
Example) 10ms for the highest queue, 20ms for the middle, 40ms for the lowest
Lower Priority, Longer Quanta
For the Time-Sharing scheduling class (TS)
The highest priority: 20msec The lowest priority: A few hundred milliseconds
14 Youjip Won
The refined set of MLFQ rules:
15 Youjip Won
Disclaimer: This lecture slide set was initially developed for Operating System course in Computer Science Dept. at Hanyang University. This lecture slide set is for OSTEP book written by Remzi and Andrea at University of Wisconsin.
16 Youjip Won