Scheduling Classes and Real-Time Scheduling in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St.

Slides:



Advertisements
Similar presentations
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Advertisements

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Process Scheduling in Linux (Chap.7 in Understanding the Linux Kernel) J. H. Wang Oct. 1, 2009.
Sogang University Advanced Operating Systems (Process Scheduling - Linux) Advanced Operating Systems (Process Scheduling - Linux) Sang Gue Oh, Ph.D. .
Sporadic Server Scheduling in Linux Theory vs. Practice Mark Stanovich Theodore Baker Andy Wang.
Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs. Nonpreemptive Scheduling 8.4Priorities 8.5Scheduling Objectives.
Project 2 – solution code
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.
Task scheduling What are the goals of a modern operating system scheduler, and how does Linux achieve them?
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Chapter 6: CPU Scheduling
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
More Scheduling cs550 Operating Systems David Monismith.
1 Multimedia Storage Issues. NUS.SOC.CS5248 OOI WEI TSANG 2 Media vs. Documents large file size write once, read many deadlines!
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.
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
Practical Schedulability Analysis for Generalized Sporadic Tasks in Distributed Real-Time Systems Yuanfang Zhang 1, Donald K. Krecker 2, Christopher Gill.
Adding a Scheduling Policy to the Linux Kernel By Juan M. Banda CS518 Advanced Operating Systems.
Scheduling policies for real- time embedded systems.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
CPU Scheduling Presentation by Colin McCarthy. Runqueues Foundation of Linux scheduler algorithm Keeps track of all runnable tasks assigned to CPU One.
Process Scheduling in Linux (Chap. 11, Understanding the Linux Kernel) J. H. Wang Sep. 26, 2008.
RTOS task scheduling models
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Scheduling II: priority scheduling.
Traditional UNIX Scheduling Scheduling algorithm objectives Provide good response time for interactive users Ensure that low-priority background jobs do.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
Periodic scheduler for Linux OS
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.
For a good summary, visit:
How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO
Time Sources and Timing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Operating Systems Unit 5: – Processor scheduling – Java – Linux – Windows XP Operating Systems.
Kernel Tracing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Process Scheduling II 3/6/13COMS W4118. Spring 2013, Columbia University. Instructor: Dr. Kaustubh Joshi, AT&T Labs. 1 COMS W4118 Prof. Kaustubh R. Joshi.
REAL-TIME OPERATING SYSTEMS
Scheduling of Non-Real-Time Tasks in Linux (SCHED_NORMAL/SCHED_OTHER)
Chapter 5a: CPU Scheduling
Time Sources and Timing
Midterm Review David Ferry, Chris Gill
Networks and Operating Systems: Exercise Session 2
Kernel Tracing David Ferry, Chris Gill
Time Sources and Timing
CS 3204 Operating Systems Lecture 14 Godmar Back.
Linux kernel: Processes, threads and scheduling
Scheduling.
Enforcing Real-Time Behavior I
Process Scheduling Decide which process should run and for how long
Top Half / Bottom Half Processing
Kernel Synchronization I
Overview of the Lab 2 Assignment: Multicore Real-Time Tasks
CS703 – Advanced Operating Systems
Scheduling of Regular Tasks in Linux
Time Sources and Timing
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Scheduling Classes and Real-Time Scheduling in Linux
Linux Process State Scheduling information Identifiers
Linux Scheduling CSE 2431: Introduction to Operating Systems
Scheduling of Regular Tasks in Linux
Real-Time Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

Scheduling Classes and Real-Time Scheduling in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO

Scheduling Classes Multiple schedulers are implemented as different scheduling classes. Normal: – SCHED_NORMAL : regular, interactive CFS tasks – SCHED_BATCH : low priority, non-interactive CFS tasks – SCHED_IDLE : very low priority tasks Real-time: – SCHED_RR : round-robin – SCHED_FIFO : first-in, first-out – SCHED_DEADLINE : earliest deadline first CSE 522S – Advanced Operating Systems2

struct sched_class CSE 522S – Advanced Operating Systems3 A few major functions: Other functions: Task migration Task yielding Task state queries Other utilities

Current Scheduling Classes and Ordering 1.stop_sched_class //for halting processors 2.dl_sched_class 3.rt_sched_class 4.fair_sched_class 5.idle_sched_class Declared in /kernel/sched/sched.h CSE 522S – Advanced Operating Systems4

Example sched_class Definition CSE 522S – Advanced Operating Systems5 From: /kernel/sched/rt.c

How the Next Runnable Task is Picked CSE 522S – Advanced Operating Systems6 Have all scheduling classes try to pick a new task The last class, SCHED_IDLE, should always return some idle task Function pick_next_task() from /kernel/sched/core.c

Real-Time Scheduling CSE 522S – Advanced Operating Systems7 Real-time tasks execute repeatedly (usually are periodic) under some time constraint Task E.g., a task is released to execute every 5 msec, and each invocation has a deadline of 5 msec Separate priority range from nice: Priorities range from 1 (low) to 99 (high) 0ms5ms10ms Time

Real-Time OS Support Goal is to achieve predictable execution: Sources of uncertainty (and solutions): – Scheduling preemptions (real-time scheduling) – Interrupts (can mask interrupts) – Migrations (can pin tasks to cores) – OS latency & jitter (RT_PREEMPT patch set) CSE 522S – Advanced Operating Systems8 Ideal:Real world: PreemptMigrate

SCHED_RR Round-robin scheduling Among tasks of equal priority: Rotate through all tasks Each task gets a fixed time slice Cannot run if higher priority tasks are runnable CSE 522S – Advanced Operating Systems9 Task 1 Task 2 Task 3 Time Task 1 Task 2 Task 3 Task 1 Task 2 Task 3

SCHED_FIFO First-in, First-out scheduling The first enqued task of highest priority executes to completion A task will only relinquish a processor when it completes, yields, or blocks CSE 522S – Advanced Operating Systems10 Task 1 Task 2 Task 3 Time

SCHED_DEADLINE Earliest Deadline First (EDF) scheduling Whichever task has next deadline gets to run Theory exists to analyze such systems Linux implements bandwidth reservation to prevent deadline abuse CSE 522S – Advanced Operating Systems11 Task 3 Deadline: 8 Exec time: 2 Task 2 Deadline: 12 Exec time: 3 Task 1 Deadline: 5 Exec time: 4 Time 0 Task 1 Task 2 Task