1 / 16

Scheduling

Scheduling. Unix Scheduling. Allocating CPU to a Process The amount of time that a process is allocated the CPU is called a time quantum Processes are assigned a priority CPU is allocated based on the priority of the process. Process Scheduling.

jerod
Download Presentation

Scheduling

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

  2. Unix Scheduling • Allocating CPU to a Process • The amount of time that a process is allocated the CPU is called a time quantum • Processes are assigned a priority • CPU is allocated based on the priority of the process

  3. Process Scheduling • Unix uses the round robin with multilevel feedback • In short, CPU is allocated to a process for a time quantum, when the time quantum is exceeded, the process is preempted and is added to one of several priority queues.

  4. RRMF CPU quantum = 24

  5. Scheduling Algorithm

  6. Scheduling Parameters • Priority Field • Two ranges for priorities • User priorities • Kernel priorities • High • Low

  7. Range of Priorities • Ranges of process priorities • 0 thru 127 (system dependent) • Threshold Priority (50) • PUSER 50 – user mode execution • Priorities less then 50 are general kernel level processes • PSWP 0 - kernel mode while swapping

  8. Priority Ranges 0 50

  9. Priorities • Some Priorities are hard coded • Process that about to go to sleep receive a priority based on reason for sleeping • Some are calculated • Decay function CPU ~ CPU/2 • Priority ~ (recent CPU usage/2) + base priority

  10. When Are Priorities Changed • When a process is about to sleep • Process returning from kernel mode to user mode • After the CPU usage is recalculated (caused by the clock)

  11. Priority Example • 3 process • Initial priority 60 • Clock interrupts 60 times a second • No syscalls • No other processes are ready to run

  12. Priority Example

  13. Priority Example 2

  14. User Influence on Priorities • Users can have a nominal impact on the priority assigned to their process • Nice systcall • nice(value) • Where value is added to the priority calculation • P = (recent CPU usage/2) +(base P) + nice

  15. Fair Share Scheduling • Similar in concept to RRML, but allows block of time to be allocated to a set or groups of processes • Divide user community into set of fare share groups

  16. Fair Share Scheduling • Processes within a group are subject to the same scheduling and priority constraints • Each group or set of processes are allocated a portion of the CPU

More Related