Advanced Operating Systems (M) Dr Colin Perkins School of Computing Science University of Glasgow



Similar documents
Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

Real-Time Scheduling (Part 1) (Working Draft) Real-Time System Example

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Lecture 3 Theoretical Foundations of RTOS

School of Electrical and Information Engineering University of the Witwatersrand, Johannesburg ELEN3024 Communication Fundamentals

Real Time Scheduling Basic Concepts. Radek Pelánek

How To Compare Real Time Scheduling To A Scheduled Scheduler On Linux On A Computer System With A Visualization System

Chapter 13 Embedded Operating Systems

Antonio Kung, Trialog. HIJA technical coordinator. Scott Hansen, The Open Group. HIJA coordinator

Periodic Task Scheduling

Aperiodic Task Scheduling

174: Scheduling Systems. Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS

Exercises : Real-time Scheduling analysis

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Chapter 1. Introduction. 1.1 Motivation. A high-performance processor requires large power consumption to operate at

Real Time Programming: Concepts

Overview and History of Operating Systems

Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems

Resource Reservation & Resource Servers. Problems to solve

Aperiodic Task Scheduling

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Weighted Total Mark. Weighted Exam Mark

PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design

Real-Time Systems Hermann Härtig Real-Time Communication (following Kopetz, Liu, Schönberg, Löser)

A hypervisor approach with real-time support to the MIPS M5150 processor

ENGG*4420 Real Time Systems Design Fall 2015

Predictable response times in event-driven real-time systems

HPC Wales Skills Academy Course Catalogue 2015

Improved Handling of Soft Aperiodic Tasks in Offline Scheduled Real-Time Systems using Total Bandwidth Server

ELEC 5260/6260/6266 Embedded Computing Systems

CHAPTER 1 INTRODUCTION

Performance Analysis of Web based Applications on Single and Multi Core Servers

Contents. Introduction. Introduction and Motivation Embedded Systems (ES) Content of Lecture Organisational

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

The Fastest Way to Parallel Programming for Multicore, Clusters, Supercomputers and the Cloud.

Control 2004, University of Bath, UK, September 2004

Industry 4.0 and Big Data

What s New in Mike Bailey LabVIEW Technical Evangelist. uk.ni.com

CS 589 Project Smart Home Hub, Phase I Due before 9am on October 21, 2015

Least Slack Time Rate First: an Efficient Scheduling Algorithm for Pervasive Computing Environment

Gildart Haase School of Computer Sciences and Engineering

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Mixed-Criticality: Integration of Different Models of Computation. University of Siegen, Roman Obermaisser

Design Pattern for the Adaptive Scheduling of Real-Time Tasks with Multiple Versions in RTSJ

Summer projects for Dept. of IT students in the summer 2015

Introduction to Software Engineering

Real- Time Scheduling

Software engineering for real-time systems

Dell Desktop Virtualization Solutions Stack with Teradici APEX 2800 server offload card

4. Fixed-Priority Scheduling

Matrix42. License Compliance of Virtual Workplaces

Trends in Embedded Software Engineering

Communication and Embedded Systems: Towards a Smart Grid. Radu Stoleru, Alex Sprintson, Narasimha Reddy, and P. R. Kumar

Operating System Aspects. Real-Time Systems. Resource Management Tasks

Real Time Network Server Monitoring using Smartphone with Dynamic Load Balancing

Chapter 1- Introduction. Lecture 1

BIG CPU, BIG DATA. Solving the World s Toughest Computational Problems with Parallel Computing. Alan Kaminsky

The simple case: Cyclic execution

Masters in Human Computer Interaction

sel4: from Security to Safety Gernot Heiser, Anna Lyons NICTA and UNSW Australia

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

School of Computer Science

Discrete-Event Simulation

Technology Big Data Solutions for Aeronautics : value, issues and solution. Business Models. Usage

Lecture 1. Introduction to Embedded Computer Systems

CSCI E 98: Managed Environments for the Execution of Programs

A Software Engineering Model for Mobile App Development

Chapter 1- Introduction. Lecture 1

Java Environment for Parallel Realtime Development Platform Independent Software Development for Multicore Systems

OPC COMMUNICATION IN REAL TIME

Long-term monitoring of apparent latency in PREEMPT RT Linux real-time systems

Operating Systems 4 th Class

Common Approaches to Real-Time Scheduling

Software Engineering. Introduc)on

ACCELERATING SELECT WHERE AND SELECT JOIN QUERIES ON A GPU

Software Engineering for Real- Time Systems.

INTERNET OF THE THINGS (IoT): An introduction to wireless sensor networking middleware

HARD REAL-TIME SCHEDULING: THE DEADLINE-MONOTONIC APPROACH 1. Department of Computer Science, University of York, York, YO1 5DD, England.

Contents. Chapter 1. Introduction

sensors and actuators? How do we handle the errors introduced due to noise, quantization etc?

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Chapter 2: Transparent Computing and Cloud Computing. Contents of the lecture

BIG CPU, BIG DATA. Solving the World s Toughest Computational Problems with Parallel Computing. Alan Kaminsky

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Parametric Analysis of Mobile Cloud Computing using Simulation Modeling

IT 342 Operating Systems Fundamentals Fall 2014 Syllabus

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

International Journal of Computer Science Trends and Technology (IJCST) Volume 2 Issue 4, July-Aug 2014

Transcription:

Advanced Operating Systems (M) Dr Colin Perkins School of Computing Science University of Glasgow

Rationale Radical changes to computing landscape; Desktop PC becoming irrelevant Heterogeneous, multicore, mobile, and real-time systems smart phones, tablets now ubiquitous Not reflected by corresponding change in operating system design practice This course will... review research on systems programming techniques and operating systems design; discuss the limitations of deployed systems; and show how the operating system infrastructure might evolve to address the challenges of supporting modern computing systems. 2

Aims and Objectives To explore programming language and operating system facilities essential to implement real-time, reactive, and embedded systems To discuss limitations of widely-used operating systems, introduce new design approaches to address challenges of security, robustness, and concurrency To give an understanding of practical engineering issues in real-time and concurrent systems; and suggest appropriate implementation techniques 3

Intended Learning Outcomes (1) At the end of this course, you should be able to: clearly differentiate the issues that arise in designing real-time systems; analyse a variety of real-time scheduling techniques, prove correctness of the resulting schedule; implement basic scheduling algorithms; understand how to apply real-time scheduling theory to the design and implementation of a real-world system using the POSIX real-time extensions, and be able to demonstrate how to manage resource access in such a system; describe how embedded systems are constructed, and discuss the limitations and advantages of C as a systems programming language; understand how managed code and advanced type systems might be used in the design and implementation of future operating systems; discuss the advantages and disadvantages of integrating garbage collection with the operating system/runtime; understand the operation of popular garbage collection algorithms; know when it might be appropriate to apply garbage collection and managed runtimes to real-time systems; 4

Intended Learning Outcomes (2) understand the impact of heterogeneous multicore systems on operating systems; compare and evaluate different programming models for concurrent systems, their implementation, and their impact on operating systems; construct and/or analyse simple concurrent programs using transactional memory and/or message passing, to understand the trade-offs and implementation decisions. 5

Course Outline Real-time operating systems Real-time scheduling Resource allocation Programming model Garbage collection Implications of multicore systems Message passing Transactions General purpose GPU programming models 6

Timetable (1) Week Lecture Subject Lecture 1 Principles of Real-time Systems 1 Lecture 2 Real-time Scheduling of Periodic Tasks (1) Lecture 3 Real-time Scheduling of Periodic Tasks (2) 2 No lectures Tutorial 1 Real-time Scheduling of Periodic Tasks 3 No lectures Lecture 4 Real-time Scheduling of Aperiodic and Sporadic Tasks (1) 4 Lecture 5 Real-time Scheduling of Aperiodic and Sporadic Tasks (2) 5 Tutorial 2 Lecture 6 Lecture 7 Tutorial 3 Real-time Scheduling of Aperiodic and Sporadic Tasks Resource Management Real-time & Embedded Systems Programming Resource Management/Systems Programming 7

Timetable (2) Week Lecture Subject Lecture 8 Garbage Collection (1) 6 Lecture 9 Garbage Collection (2) Tutorial 4 Lecture 10 Garbage Collection Implications of Multicore Systems 7 Lecture 11 Message Passing (1) Lecture 12 Message Passing (2) 8 Tutorial 5 Lecture 13 Tutorial 6 Message Passing Transactions Transactions 9 No lectures Lecture 14 General Purpose GPU Programming (1) 10 Lecture 15 General Purpose GPU Programming (2) Tutorial 7 General Purpose GPU Programming 8

Assessment Level M course; 10 credits Coursework (20%) Exercise Weight Topic Set Due 1 4% Scheduling periodic tasks Tutorial 1 Tutorial 2 2 4% Scheduling aperiodic/sporadic tasks Tutorial 2 Tutorial 3 3 12% Programming message passing systems Tutorial 5 Tutorial 7 Examination (80%) Two hours duration; sample and past papers are available on Moodle All material in the lectures, tutorials, and cited papers is examinable Aim is to test your understanding of the material, not to test your memory of all the details; explain why don t just recite what 9

Pre- and co-requisites Required pre-requisites: Computer Systems 2 Operating Systems 3 Advanced Programming 3 Functional Programming 4 Recommended co-requisites: Computer Architecture 4 10

Required Reading No single set text book Research papers will be cited DOIs will be provided; resolve via http://dx.doi.org/ some papers behind paywalls, but accessible for free from on campus You are expected to read and understand papers; it will be beneficial to follow-up on some of the references and do further background reading Critical reading of a research paper is difficult and requires practice; read in a structured manner, not end-to-end, thinking about the material as you go Advice on paper reading: http://www.eecs.harvard.edu/~michaelm/postscripts/readpaper.pdf S. Keshav, How to Read a Paper, ACM Computer Communication Review, 37(3), July 2007 DOI: 10.1145/1273445.1273458 Tutorials allow for discussion of papers and lectured material 11

Resources and Contact Details Lecture slides and other materials are on Moodle Also http://csperkins.org/teaching/adv-os/ Printed lecture handouts will not be provided learning is enhanced by taking your own notes during lectures and tutorials Course coordinator: Dr Colin Perkins, Room S101b, Lilybank Gardens Email: colin.perkins@glasgow.ac.uk No assigned office hours email to make appointment if needed 12

Principles of Real-time Systems Advanced Operating Systems Lecture 1

Introduction to Real-time Systems Real-time systems deliver services while meeting timing constraints Not necessarily fast, but must meet some deadline Many real-time systems embedded as part of a larger device or system: washing machine, photocopier, phone, car, aircraft, industrial plant, etc. Frequently require validation for correctness Many embedded real-time systems are safety critical if they don t work in a timely and correct basis, serious consequences result Bugs in embedded real-time systems can be difficult or expensive to repair e.g., can t easily update software in a car 14

Typical System Model Reference input: r(t) A/D A/D y(t) Sensor rk yk Control-law computation Device uk Controller D/A u(t) Actuator Control a device using actuator, based on sampled sensor data Control loop compares measured value and reference Depends on correct control law computation, reference input, accuracy of measurements Time between measurements of y(t), r(t) is the sampling period, T Small T better approximates analogue control but large T needs less processor time; if T is too large, oscillation will result as the system fails to keep up with changes in the input Simple control loop conceptually easy to implement Complexity comes from multiple control loops running at different rates, of if the system contains aperiodic components 15

Implementation Considerations Some real-time embedded systems are complex, implemented on high-performance hardware E.g., industrial plant control, avionics and flight control systems But, many implemented on hardware that is low cost, low power, and low performance, but lightweight and robust E.g., consumer goods Often implemented in C or assembler, fitting within a few kilobytes of memory; correctness primary concern, efficiency a close second Desire proofs of correctness, ways of raising the level of abstraction programming such systems 16

Reference Model for Real-time Systems A reference model and consistent terminology let us reason about real-time systems Cannot prove correctness without well-defined system model Reference model needs to characterise: Applications running on a system (jobs and tasks) and the processors supporting their execution The resources those applications use Scheduling algorithms to determine when applications execute and use resources, and the timing constraints they must meet 17

Jobs, Tasks, Processors, and Resources A job is a unit of work scheduled and executed by the system A task T = {J1, J2,, Jn} is a set of related jobs that together perform some operation Jobs execute on a processor and may depend on some resources A scheduling algorithm describes how jobs execute Processors are active devices on which jobs are scheduled E.g., threads scheduled on a CPU, data scheduled on a transmission link A processor has a speed attribute, that determines the rate of progress of jobs executing on that processor A resource, R, is a passive entity on which jobs may depend A hardware device, for example Resources have different types or sizes, but have no speed attribute and are not consumed by use Jobs compete for resources, and can block if a resource is in use 18

Deadlines and Timing Constraints Timing Constraints Completion time the instant at which a job completes execution Job Relative Ji executes deadline for the maximum time ei allowable time to job finish response Ji given time sole use of processor, and all required resources Absolute deadline the instant of time by which a job is required to be completed (often called simply the deadline) Execution time depends on input data use worst case for safety absolute deadline = release time + relative deadline Jobs Feasible have interval timing for a constraints job J relative or absolute i is the interval (r i, d i ] deadlines: Deadlines are examples of timing constraints Relative deadline, D i Response time Copyright 2006 University of Glasgow All rights reserved. r i - r i + Release time, r i Job, J i Completion time Time Absolute deadline, d i 19

Timing Constraints: Example A system to monitor and control a heating furnace The system takes 20ms to initialise when turned on After initialisation, every 100ms, the system: Samples and reads the temperature sensor Computes the control-law for the furnace to process the temperature readings, determine the correct flow rates of fuel, air, and coolant Adjusts the flow rates to match the computed values The system can be modelled as a task, T, comprising jobs J0, J1,, Jk, The release time of Jk is 20 + (k 100)ms The relative deadline of Jk is 100ms; the absolute deadline is 20 + ((k + 1) 100)ms Relative deadline = 100ms Slack time Absolute deadline for J2 = 320ms 0 20 120 220 320 420 J0 J1 J2 J3 20

Periodic Tasks If jobs occur on a regular cycle, the task is periodic and characterised by parameters Ti = (φi, pi, ei, Di) Phase, φi, of the task is the release time of the first job (if omitted, φi = 0) Period, pi, of the task is the time between release of consecutive jobs Execution time, ei, of the task is the maximum execution time of the jobs Relative deadline, Di, is the minimum relative deadline of the jobs (if omitted, Di = pi) Utilisation of a task is ui = ei / pi and measures the fraction of time for which the task executes The total utilisation of a system U = X i u i Common in real-world control systems 21

Aperiodic and Sporadic Tasks If jobs have unpredictable release times, a task is termed aperiodic A sporadic task is an aperiodic task where the jobs have deadlines once released Greatly complicate reasoning about correctness Helpful if bounds or probability distributions of release times and deadlines can be determined 22

The Real-time Scheduling Problem Need to schedule jobs and manage resources In a valid schedule for a set of jobs: Processors are assigned at most one job at once; jobs are assigned at most one processor at once No job is scheduled before its release Processor time assigned to each job equals its maximum execution time All the precedence and resource usage constraints are satisfied A feasible schedule is valid, and jobs meet timing constraints not all valid schedules are feasible An optimal scheduling algorithm will always find a feasible schedule if it exists 23

Hard and Soft Real-time Systems The firmness of timing constraints affects how we engineer the system If a job must never miss its deadline, the system is hard real-time A timing constraint is hard is failure to meet it is considered a fatal error A timing constraint is hard if the usefulness of the results falls off abruptly at the deadline A timing constraint is hard if the user requires validation (formal proof or exhaustive simulation, potentially with legal penalties) that the system always meets the constraint If some deadlines can be missed occasionally, with low probability, then the system is described as soft real-time Hard and soft real-time are two ends of a spectrum In many practical systems, the constraints are probabilistic, and depend on the likelihood and consequences of failure No system is guaranteed to always meet its deadlines: there is always some probability of failure 24

Further Reading Next few lectures will focus on real-time scheduling Recommended reading: Jane W. S. Liu, Real-Time Systems, Prentice Hall, 2000, ISBN 0130996513 25