1 / 13

Scheduling: Th e Multi Level Feedback Queue

Learn about the Multi-Level Feedback Queue scheduling algorithm, its rules, and how it optimizes turnaround and response times. Explore examples, challenges, and solutions to common issues. Discover how MLFQ approximates SJF and effectively manages job priorities.

scottdiaz
Download Presentation

Scheduling: Th e Multi Level Feedback Queue

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scheduling:The Multi Level Feedback Queue Ilsoo Byun(isbyun@dcslab.snu.ac.kr) School of Computer Science and Engineering Seoul National University

  2. Outline Introduction Basic Rules Summary

  3. Introduction • Invented by Corbato • Lead to award him the “Turing Award” • Schedule without perfect knowlede • Approximate SJF (Shortest Job First) • Optimize turnaround time • Minimize reponse time

  4. MLFQ: Basic Rules High Priority B A Q4 Q3 C Q2 D Q1 Processor Low Priority Rule 1. If Priority(A) > Priority(C), A runs Rule 2. If Priority(A) = Priority(B), A & B run in RR

  5. Attempt #1: How To Change Priority Rule 3: When a job enters the system, it is placed at the highest priority. (the topmost queue) 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.

  6. Example 1: A Single Long-Running Job Q2 Q1 Q0 10ms 10ms Scheduler first assumes a job might be short. If it’s not, the job will slowly move down the queues.

  7. Example 2: Along Came A Short Job A Process B Process Q2 Q1 Q0 10ms 10ms If a job is actually short, It will run quickly and complete.

  8. Example 3: What About I/O? A Process B Process Q2 Q1 Q0 If a job gives up the processor before using up its timeslice, It will stay at the same priority level.

  9. Problems With Our Current MLFQ (1) A Process B Process Q2 Q1 Q0 • To game the scheduler • Trick the scheduler to get more than its fair share of the resource

  10. Attempt #2: Better Accounting A Process You exhausted your share B Process Q2 You exhausted your share Q1 Q0 Rule 4: Once a job uses up its time allotment at a given level, its priority is reduced.

  11. Problems With Our Current MLFQ (2) A Process B Process C Process Q2 Q1 Q0 I’m hungry • Starvation • If there are too many interactive jobs, long running jobs will never receive any CPU time.

  12. Attempt #3: The Priority Boost Boost! Boost! Boost! Q2 A Process B Process Q1 C Process Q0 0 50 100 200 150 Rule 5: After some time period S, move all the jobs in the system to the topmost queue.

  13. Summary • MLFQ approximates SJF • MLFQ Basic Rules • Rule 1: If Priority(A) > Priority(C), A runs • Rule 2: If Priority(A) = Priority(B), A & B run in RR • Rule 3: When a job enters the system, it is placed at the highest priority. (the topmost queue) • 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 in the system to the topmost queue.

More Related