1 / 14

Linux Process Management

Linux Process Management . Linux Implementation of Threads. Threads enable concurrent programming / true parallelism Linux implementation of threads. PCS vs SCS. http://www.cs.uic.edu/~ jbell/CourseNotes/OperatingSystems/5_CPU_Scheduling.html. Linux Process Scheduling. Policy

burton
Télécharger la présentation

Linux Process Management

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. Linux Process Management

  2. Linux Implementation of Threads • Threads enable concurrent programming / true parallelism • Linux implementation of threads

  3. PCS vs SCS • http://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/5_CPU_Scheduling.html

  4. Linux Process Scheduling • Policy • Policy is the behavior of the scheduler that determines what runs when. A scheduler’s policy often determines the overall feel of a system. • I/O-Bound vs. Processor-Bound Processes • Scheduler policy in Unix systems tends to explicitly favor I/O-bound processes • Linux..

  5. Process priority • 2 ranges • nice value • -20 to +19 with default of 0 • Larger nice values correspond to lower priority • ps –el • real-time priority • 0 -99 • Higher values correspond to higher priority • Used for real-time processes – always higher than normal processes.

  6. The scheduling policy in action

  7. Process Scheduling in Unix • Based on traditional methods • Timeslice • Priority (Priority exported to user in nice values) • Problematic • Two low priority processes swap to much • Timeslice / priority correlation • Timeslice measurement (timer click)

  8. The scheduling policy in action • Linux: Completely Fair Scheduling • Model process scheduling as if the system had an ideal perfectly multitasking processor. • That is, each process receives 1/n of the processor’s time, where n is the number of runnable processes and we’d schedule them for intimately small durations, so that in any measureable period we’d have urn all n processes for the same time. • Conceptually: we are running 2 processes simultaneously each using 50% of CPU

  9. Completely Fair Scheduling (CFS) • CFS will run each process for some amount of time, round-robin, selecting next the process that has run the least.

  10. Completely Fair Scheduling (CFS)Determine Time allotted to run • CFS calculates how long a process should run as a function of the total number of runnable processes • CFS uses the nice value to weight the proportion of the processor a process should receive.

  11. Completely Fair Scheduling (CFS)Determine Time allotted to run • Each process then runs for a “time-slice” proportional to its weight divided by the total weight of all runnable threads.

  12. Completely Fair Scheduling (CFS)Picking the next task • Red/black trees • Balanced tree • Leftmost leaf contains process with the smallest runtime (time spent running) normalized by the number of runnable processes and by its ‘weight’

  13. Kernel Preemption • Unix kernel is non-preemptive • Linux kernel is pre-emptive

  14. Real-Time Scheduling Policies • SCHED_FIFO and SCHED_RR • Not managed by CFS, but by a separate real-time scheduler. • Soft real-time behavior

More Related