Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads.

Similar presentations


Presentation on theme: "Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads."— 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/Op eratingSystems/5_CPU_Scheduling.html http://www.cs.uic.edu/~jbell/CourseNotes/Op eratingSystems/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


Download ppt "Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads."

Similar presentations


Ads by Google