LINUX SCHEDULING Evolution in the 2.6 Kernel Kevin Lambert Maulik Mistry Cesar Davila Jeremy Taylor.

Slides:



Advertisements
Similar presentations
1 Always want to have CPU (or CPU’s) working Usually many processes in ready queue –Ready to run on CPU –Focus on a single CPU here Need strategies for.
Advertisements

CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Operating Systems Process Scheduling (Ch 3.2, )
Abdulrahman Idlbi COE, KFUPM Jan. 17, Past Schedulers: 1.2 & : circular queue with round-robin policy. Simple and minimal. Not focused on.
Sogang University Advanced Operating Systems (Process Scheduling - Linux) Advanced Operating Systems (Process Scheduling - Linux) Sang Gue Oh, Ph.D. .
Completely Fair Scheduler Alireza Heidari. Introduction The Completely Fair Scheduler (CFS) is a process scheduler. Merged into the release of.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 6: CPU Scheduling.
CENG 334 – Operating Systems 05- Scheduling
Operating System Process Scheduling (Ch 4.2, )
Operating System I Process Scheduling. Schedulers F Short-Term –“Which process gets the CPU?” –Fast, since once per 100 ms F Long-Term (batch) –“Which.
Project 2 – solution code
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
1 Scheduling in Representative Operating Systems.
Chapter 5: CPU Scheduling
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
The Linux Scheduler 2.4 vs 2.6 Michael McCabe Michael McCabe
Operating Systems Process Scheduling (Ch 4.2, )
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
7/2/2015 Operating Systems Michael Elhadad, Meni Adler& Amnon Meisels 1 Course Syllabus 1. Introduction - History; Views; Concepts; Structure 2.
7/2/2015 Operating Systems, 2012, Danny Hendler & Roie Zivan 1 Course Syllabus 1. Introduction - History; Views; Concepts; Structure 2. Process Management.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
Operating System Process Scheduling (Ch 4.2, )
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Main Job: Assign processes to be executed by the processor(s) and processes to be loaded in main.
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Scheduling Dave Eckhardt Outline ● Chapter 6: Scheduling.
CPU Scheduling Chapter 6 Chapter 6.
Chapter 6: CPU Scheduling
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
Uniprocessor Scheduling
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Self stabilizing Linux Kernel Mechanism Doron Mishali, Alex Plits Supervisors: Prof. Shlomi Dolev Dr. Reuven Yagel.
Operating System Examples - Scheduling
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
CPU Scheduling Presentation by Colin McCarthy. Runqueues Foundation of Linux scheduler algorithm Keeps track of all runnable tasks assigned to CPU One.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
BFSBFS by Con KolivasCon Kolivas Guruprasad Aphale. Real Time Lunch, 10/21/ Guruprasad Aphale.
Traditional UNIX Scheduling Scheduling algorithm objectives Provide good response time for interactive users Ensure that low-priority background jobs do.
Scheuduling.
Lecture 6 Page 1 CS 111 Online Preemptive Scheduling Again in the context of CPU scheduling A thread or process is chosen to run It runs until either it.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Real Time System with MVL. © 2007 MontaVista Confidential | Overview of MontaVista Agenda Why Linux Real Time? Linux Kernel Scheduler Linux RT technology.
Operating System Examples - Scheduling. References r Silberschatz et al, Chapter 5.6, Chapter
CS333 Intro to Operating Systems Jonathan Walpole.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads.
Operating System Examples - Scheduling. References r er/ch10.html r bangalore.org/blug/meetings/200401/scheduler-
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
3. CPU Scheduling. CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive.
Scheduling.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
REAL-TIME OPERATING SYSTEMS
Scheduling of Non-Real-Time Tasks in Linux (SCHED_NORMAL/SCHED_OTHER)
Linux Scheduler.
Chapter 2 Scheduling.
Chapter 2: The Linux System Part 3
CPU SCHEDULING.
Process Scheduling Decide which process should run and for how long
Scheduling of Regular Tasks in Linux
Linux Block I/O Layer Chris Gill, Brian Kocoloski
Scheduling of Regular Tasks in Linux
CPU Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

LINUX SCHEDULING Evolution in the 2.6 Kernel Kevin Lambert Maulik Mistry Cesar Davila Jeremy Taylor

Main Topics General Process Scheduling 2.6 Kernel Processing (short-term) I/O Scheduling (disk requests)

General Scheduler Considerations 1 - Preemptive vs. Cooperative 2 - I/O-bound vs. CPU-bound 3 - Throughput Vs. Latency PRIORITY!

Text Editor vs. Video Encoder Which one has more priority in Linux? Which requires more processing? Which one requires more I/O? Which one has greater priority?

Preemption Due to timeslice running out Due to priority being lower than that of current running process

Where Did We Come From? Pre 2.6 Schedulers Didn’t utilize SMP very well  Single runqueue lock meant idle processors awaiting lock release Preemption not possible  Lower priority task can execute while high priority task waits O(n) complexity  Slows down with larger input.

Where Are We Now? The 2.6 Scheduler Each CPU has a separate runqueue  140 FIFO priority lists are for real-time tasks are for user tasks Active and Expired runqueues O(1) complexity  Constant time thanks to runqueue swap

Where Are We Now? (cont) The 2.6 Scheduler Preemption Dynamic task prioritization  Up to -5 niceness for I/O-bound  Up to +5 niceness for CPU-bound  Remember, less niceness is good… in this case. SMP load balancing  Checks runqueues every 200 ms

CFS – The Future is Now! Completely Fair Scheduler  Merged into the kernel  Runs task with the “gravest need”  Guarantees fairness (CPU usage) No runqueues!  Uses a time-ordered red-black binary tree  Leftmost node is the next process to run

Red/Black Tree Rules 4)Every path from the root to a tree leaf contains the same number (the "black-height") of black nodes. Cited from Good animation at 1)Every node has two children, each colored either red or black. 2)Every tree leaf node is colored black. 3)Every red node has both of its children colored black.

CFS Features (cont) No timeslices!... sort of  Uses wait_runtime (individual) and fair_clock (queue-wide)  Processes build up CPU debt  Different priorities “spend” time differently  Half priority task sees time pass twice as fast O(log n) complexity  Only marginally slower than O(1) at very large numbers of inputs

IO Scheduling Minimize latency on disk seeks Prioritize processes’ IO requests Efficiently share disk bandwidth between processes Guarantee that requests are issued before a deadline Avoid starvation

CFQ What it's good for:  Default system for Red Hat Enterprise Linux 4  Distributes bandwidth equally among IO requests and is excellent for multi-user environments  Offers performance for the widest range of applications and IO system designs and those that require balancing Considered anticipatory because process queue idles at the end of synchronous IO allowing IO to be handled from that process.

How CFQ Works Assigns requests to queues and priorities based on the process they are coming from Current time recorded when task enters runqueue Traffic divides into a fixed number of buckets (64 by default) ‏ Hash code from networking atm Round robin all non-empty buckets

How CFQ Works IO scheduler uses a per-queue function (not per-bucket) ‏ Runnable tasks use a 'fair clock' with runnable tasks (1/N) to increase priority Several innovations made for CFQ V2