Resource Kernels: Linux/RK

Slides:



Advertisements
Similar presentations
Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
Advertisements

Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
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.
Embedded and Real Time Systems Lecture #4 David Andrews
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
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.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
CprE 458/558: Real-Time Systems
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Threads and Scheduling 6.
Lecture 5: CPU Scheduling. Lecture 5 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents Why CPU Scheduling Scheduling Criteria & Optimization.
Embedded Linux Sandeep Sirpatil Graduate Student University of North Carolina Charlotte Feb 7, 2005.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
CprE 458/558: Real-Time Systems (G. Manimaran)1 RTLinux Lab – Introduction Cpre 558 Anil
Performance Evaluation of Real-Time Operating Systems
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Operating Systems Part III: Process Management (CPU Scheduling)
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
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.
Tittle:Real Time Linux
Introduction to Real-Time Systems
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Real-Time, Clocking, and Porting (My Job ) Determining the Real Time Capabilities of various Operating Systems. Writing code to support Real Time Clocking.
Real Time Operating Systems Introduction to Real-Time Operating Systems (Part I) Course originally developed by Maj Ron Smith.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
19.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 19: Real-Time Systems.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Real-Time Operating System Design
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.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Real-Time Operating Systems RTOS For Embedded systems.
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.
Introduction to Real-Time Operating Systems
REAL-TIME OPERATING SYSTEMS
Chapter 19: Real-Time Systems
Introduction to the CVM and the Timesys RI
Unit OS9: Real-Time and Embedded Systems
Exploring LynxOS By How-Shen Chang.
Real Time Operating Systems for Networked Embedded Systems
Chapter 2 Scheduling.
Chapter 6: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Real-Time Operating Systems
CS4101 嵌入式系統概論 RTOS Prof. Chung-Ta King Department of Computer Science
Outline Scheduling algorithms Multi-processor scheduling
CPU scheduling decisions may take place when a process:
Chapter 19: Real-Time Systems
Lecture 21: Introduction to Process Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Chapter 6: CPU Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

Resource Kernels: Linux/RK Raj Rajkumar, Kanaka Juvva, Anastasio Molano and Shui Oikawa, “Resource Kernels: A Resource-Centric Approach to Real-Time Systems”, In Proceedings of the SPIE/ACM Conference on Multimedia Computing and Networking, January 1998.

Before we start… Unix Scheduling Mainly for time-sharing Multilevel feedback queue Each queue applies Round Robin scheduling Priority varies dynamically, e.g., aging

Linux Scheduling Provides RT-POSIX interface Fixed priority real-time scheduling classes SCHED_FIFO SCHED_RR 100 priority levels Timesharing in SCHED_OTHER Relatively new preemptive Linux kernels Enough support for real-time applications?

Extend Linux for real-time support Why extend Linux? A large user base Open-source But, is the Linux footprint small enough for embedded applications?

Resource Kernel NetBW Disk CPU BW A Kernel that provides to applications Timely, Guaranteed, and Enforced access to System Resources Allows Applications to specify only their Resource Demands leaving the Kernel to satisfy those Demands using hidden management schemes Task 2 Reservation Parameters “T”: Period (1/f) “C”: Execution time within period “D”: Deadline within period Task 1 Task 3 Resource Set Rsv 1 Rsv 2 Rsv 3 Disk BW CPU NetBW Source: Dr. Rajkumar at CMU

Linux/RK Architecture Process Linux Process Linux Process User-Level Kernel Resource Kernel Linux Kernel Kernel Loadable Kernel Module Hardware Source: Dr. Rajkumar at CMU

Diversion: RTLinux Open source Linux project: www.fsmlabs.com http://tldp.org/HOWTO/RTLinux-HOWTO.html Supports x86, PowerPC, Alpha Available as a patch to the regular Linux kernel Provides an RT API for developers Runs Linux kernel as lowest priority process Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

Linux Kernel User Processes System libraries Linux kernel Device drivers I/O Hardware Interrupts Hardware Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

RTLinux Kernel Real Time Tasks Direct h/w access RTLinux Plug-in I/O Linux is executed in the background User Processes Real Time Tasks System libraries Device drivers Linux kernel I/O Software Interrupts Direct h/w access RTLinux Plug-in RT-Scheduler I/O Hardware Interrupts Hardware Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

Linux Kernel: code perspective THE controller User Process Kernel Loadable Modules Module M2 service (system call) M1 M2 M2 Linux Monolithic kernel core M3 M4 RAM DISK Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

RTLinux Kernel: code perspective THE controller RT Load command RT core Kernel Loadable Modules Load RT core RTM2 RTM3 Linux Monolithic kernel core M1 M2 RT-Core Module M3 RAM DISK Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

Getting RTLinux ready Configure and compile a fresh Linux kernel (2.4.29) Download the kernel from http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.29.tar.gz Patch the RTLinux to the Linux kernel Recompile the kernel and reboot the system into the new kernel Configure the RTLinux kernel and compile it Source: Cpre 458/558 by Dr. Manimaran at Iowa State University

Linux/RK Abstractions CMU’s Linux/RK supports several abstractions and primitives for real-time scheduling of processes with real-time and QoS requirements: Resource reservations with latency guarantees CPU cycles Network bandwidth Disk bandwidth Support for periodic tasks. Support for 256 real-time fixed-priority levels. High-resolution timers and clocks. Bounding of priority inversion during synchronization operations Also works with reservations (reservation inheritance, etc.) Wiring down of memory pages. Source: Dr. Rajkumar at CMU

Reservation Types Hard reservation: On depletion, it cannot be scheduled until it is replenished Firm reservation: On depletion, it can be scheduled if no other undepleted reservation or unreserved threads are ready to run Soft reservation: On depletion, it can be scheduled with other unreserved threads and depleted reservations

Hard reservation

Firm reservation

Soft reservation

Scheduling & Admission Control Each reservation receives a fixed priority according to period (RMS) or deadline (DMS) Admission control overhead

Disk Scheduling Traditional RT systems avoided to use disk Unpredictable latencies Disk access requests should be scheduled in conjunction with the processor scheduling Multiple resource problem with deadlines is NP-complete [5] Disk bandwidth reservations in addition to CPU cycle reservations EDF: Pick the reservation with the earliest deadline Immediate preemption of a disk access is impossible EDF is not optimal in a non-preemptive model A lot of disk head movements EDF + Just-in-time scheduling High priority tasks may finish early Exploit “slack” to serve requests close to the current head position, similar to SCAN

Workload with both CPU and Disk requirements

Commercialized Linux/RK: TimeSys Linux Resource kernel and QoS Support guaranteed, timely and enforced access to CPU cycles and network bandwidth SMP support with QoS Reservations Fully preemptive kernel Fixed-priority scheduling (POSIX-compliant) High-resolution timer and clock support (microsecond resolution) Periodic processes Message queues Priority inheritance and priority ceiling protocol emulation support to avoid unbounded priority inversion SuiteTime tools App App RT-App RT-App Real-Time Java TimeSys Linux/RT Source: Dr. Rajkumar at CMU TimeSys Corporation

TimeSys Linux TimeSys Linux/GPL TimeSys Linux/Real-time Basic TimeSys Linux kernel Full preemption at the kernel level, prioritized interrupt handlers, unlimited priorities, ... TimeSys Linux/Real-time Support priority inheritance and a POSIX-based high-resolution timer API TimeSys Linux/CPU Support CPU reservation, which gives a thread, process, or process group exclusive use of the CPU. TimeSys Linux/Net Support network bandwidth reservation to guarantee that your thread or process will get the bandwidth it requires, regardless of network activity in other processes TimeSys Linux GPL: Downloadable from sourceforge.net/projects/timesysgpl TimeSys Linux Install mini HOWTO: http://doc.ece.uci.edu/~tharmon/files/TimeSys-Linux-Install-mini-HOWTO.html

#Priority levels and EDF EDF is hard to implement because most operating systems only support a fixed number of priority levels (typically <= 256) Deadline scheduling, e.g., EDF, can be better fixed priority scheduling which is oblivious to deadlines Example: Consider the following scenario in RMS TH DH TL DL

Fixed priority vs. Dynamic priority Supported by most kernels Simple & little overhead Low utilization bound RMS: 0.69 Dynamic priority Deadline is the first class citizen High utilization bound: 1 in EDF Limited priority levels in most kernels More complex; High overhead

Average kernel preemption latency comparison OS Average latency (us) Linux < 10,000 100,000 Linux with preemptive kernel < 1,000 TimeSys Linux/GPL < 50 1,000 TimeSys Linux/Real-Time < 10 51 Source: http://linuxdevices.com/articles/AT6106723802.html

Others Unix-based: QNX, LynxOS, … Proprietary: pSOS, VxWorks, VRTX, … More recently eCos L4 μcOS-II

Announcement: Midterm Exam Midterm Exam on Oct. 12, 2006 for both on-campus and EngiNet students Format: In-Class, Closed-book, Closed-note exam Study Real-Time Scheduling, Synchronization, and Real-Time Operating Systems covered up to today’s lecture Focus on my lecture slides (supplemented by the papers on the reading list) From Oct. 2, we will discuss RTDB – Read paper [D1] in the reading list