ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni.

Slides:



Advertisements
Similar presentations
Sogang University Advanced Operating Systems (Process Scheduling - Linux) Advanced Operating Systems (Process Scheduling - Linux) Sang Gue Oh, Ph.D. .
Advertisements

Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CS 345 Computer System Overview
Computer Systems/Operating Systems - Class 8
1 Threads, SMP, and Microkernels Chapter 4. 2 Process: Some Info. Motivation for threads! Two fundamental aspects of a “process”: Resource ownership Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Operating System Support Focus on Architecture
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Chapter 13 Embedded Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Computer Organization and Architecture
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
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.
I/O Systems I/O Hardware Application I/O Interface
Virtualization: Not Just For Servers Hollis Blanchard PowerPC kernel hacker.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Processor Architecture
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Real Time System with MVL. © 2007 MontaVista Confidential | Overview of MontaVista Agenda Why Linux Real Time? Linux Kernel Scheduler Linux RT technology.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
Lecture 27 Multiprocessor Scheduling. Last lecture: VMM Two old problems: CPU virtualization and memory virtualization I/O virtualization Today Issues.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
REAL-TIME OPERATING SYSTEMS
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 5a: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Chapter 2: The Linux System Part 3
Chapter5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
CPU scheduling decisions may take place when a process:
Chapter 6: CPU Scheduling
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni

/ 30 Topic Today: OS Key traditional requirements of Real-Time OS: 1.OS Predictability 2.User Configurability 3.Reliability Additional requirement – OS should efficiently support the underlying HW platform. Especially important for multicore! Unfortunately, traditional OS design is far from predictable… 2

LITMUS 3

/ 30 LITMUS Linux Testbed for Multiprocessor Scheduling in Real- Time Essentially, a soft-real time multiprocessor tested Implements a variety of different scheduling algorithm and synchronization mechanisms Many papers for different platforms… 4

/ 30 Implementation Issues… Scheduling plug-ins Locks and Run-Queues Migration and race conditions Timers implementation Quantum implementation Run queue implementation Debugging 5

/ 30 Other Common Issues Interrupts –In Linux, typically divided in top and bottom handler –Top (ISR): creates unpredictable interference –Bottom (kernel thread): must be properly scheduled Priority Inversions in the Kernel Virtual Memory –Paging has no concept of task priority –Global replacement decisions do not guarantee isolation I/O Scheduling –Similar to virtual memory, except the OS often has less control 6

/ 30 Refresh: Multiprocessor Scheduling 7

/ 30 Measured Overheads: Niagara 8

/ 30 Results: Niagara, HR light tasks 9

/ 30 Results: Niagara, HR medium tasks 10

/ 30 Results: Niagara, HR heavy tasks 11

/ 30 Results: Niagara, SR light tasks 12

/ 30 Results: Niagara, SR medium tasks 13

/ 30 Results: Niagara, SR heavy tasks 14

/ 30 Other Platforms… An Empirical Comparison of Global, Partitioned, and Clustered Multiprocessor EDF Schedulers Intel Xeon, 8 sockets, 6 cores per socket (total 24 cores). LVL2 shared among 2 cores, LVL3 shared among 6 cores. Abandoned P-fair… Weighted schedulability: –D: cache-induced delay –S(U,D): percentage schedulable task sets for utilization U and cache delay D 15

/ 30 Cache-Induced Delay, Intel 16

/ 30 Results: Intel, SR light tasks 17

/ 30 Results: Intel, SR medium tasks 18

/ 30 Results: Intel, SR heavy tasks 19

/ 30 Resource Sharing In Multicore Real-Time Synchronization on Multiprocessor: To Block or Not to Block, to Suspend or Spin? General solution adopted by the authors: –If resource is shared only by tasks within the same run- queue, use priority inheritance (GEDF) or SRP (PEDF) –If resource is shared among tasks in multiple run- queues, simply run the task non-preemptively. 20

/ 30 Alternative? Spin-lock –Busy-waiting until you get the resource; supports FIFO ordering to prevent starvation Lock-free –Try to perform an operation on the object; if it fails, retry until success. –If multiple tasks try at the same time, at least one will succeed. Wait-free –No retry, every task succeeds after fixed number of instructions (can be large). Lock and wait-free: very dependent on data structure 21

/ 30 Spinning is better than suspending… 22

/ 30 … unless you care about background computation 23

Interrupt Management 24

/ 30 Accounting for Interrupts An overview of interrupt accounting techniques for multiprocessor real-time systems What to get out of the paper: –Types of interrupts –Maskable / Non-maskable –Split interrupt handling –Dedicated interrupt core, timer multiplexing –… and the three ways to account (quantum, task and core-based). 25

/ 30 Results: Niagara, HR light tasks 26

/ 30 Results: Niagara, HR light tasks 27

/ 30 Results: Niagara, SR light tasks 28

/ 30 Interrupt Management – Device Interrupts What to do with Device Interrupts? Fundamental tradeoffs: –Serve the device as soon as possible – high interference on real-time tasks. –Do not serve the device – high latency/data lost. Interrupt coalescing (ex: network cards) –Buffer large amount of data on device (input) or main memory (output) –Send an interrupt only after buffers are full (input) / empty (output) 29

/ 30 Interrupt Accounting – Device Interrupts Bottom-half can be scheduled as an aperiodic task. Top-half solutions: –Allow all ISR, bound interference (i.e., dbf) –Regulate in hw. –Regulate in sw – use a non-preemptive aperiodic server. –Ex: Non-preemptive interrupt scheduling for safe reuse of legacy drivers in real-time systems 30 UsUs 1-U s