Dispatching Domains for Multiprocessor Platforms and their Representation in Ada



Similar documents
ICS Principles of Operating Systems

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Today. Intro to real-time scheduling Cyclic executives. Scheduling tables Frames Frame size constraints. Non-independent tasks Pros and cons

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

CPU Scheduling. CPU Scheduling

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Your partner when introducing and using modern software development tools. Klaus Wachsmuth Dr. Peter Dencker

Aperiodic Task Scheduling

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

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

Implementing Ada.Real_Time.Clock and Absolute Delays in Real-Time Kernels

Real-Time Scheduling 1 / 39

CPU Scheduling Outline

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

4. Fixed-Priority Scheduling

CPU Scheduling. Core Definitions

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

W4118 Operating Systems. Instructor: Junfeng Yang

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

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun

CHAPTER 1 INTRODUCTION

Linux Scheduler. Linux Scheduler

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

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Attaining EDF Task Scheduling with O(1) Time Complexity

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Predictable response times in event-driven real-time systems

Lecture 3 Theoretical Foundations of RTOS

OPERATING SYSTEMS SCHEDULING

Chapter 5 Process Scheduling

Processor Scheduling. Queues Recall OS maintains various queues

Real- Time Scheduling

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

Comparison of the Three CPU Schedulers in Xen

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Operating System: Scheduling

Job Scheduling Model

RT Language Classes. Real-Time Programming Languages (ADA and Esterel as Examples) Implementation. Synchroneous Systems Synchronous Languages

Implementing and Using Execution Time Clocks in Ada Hard Real-Time Applications

W4118 Operating Systems. Instructor: Junfeng Yang

An Implementation Of Multiprocessor Linux

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

STORM. Simulation TOol for Real-time Multiprocessor scheduling. Designer Guide V3.3.1 September 2009

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

Partitioned EDF Scheduling for Multiprocessors using a C=D Scheme

Programming real-time systems with C/C++ and POSIX

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

Linux scheduler history. We will be talking about the O(1) scheduler

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Improvement of Scheduling Granularity for Deadline Scheduler

Why Relative Share Does Not Work

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

Priority-Driven Scheduling

Real-Time Multi-Core Virtual Machine Scheduling in Xen

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Multi-core Programming System Overview

ARINC-653 Inter-partition Communications and the Ravenscar Profile

Quality of Service su Linux: Passato Presente e Futuro

Real-Time Multi-Core Virtual Machine Scheduling in Xen

Asymmetric Scheduling and Load Balancing for Real-Time on Linux SMP

Chapter 5 Linux Load Balancing Mechanisms

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Hard Real-Time Linux

Exercises : Real-time Scheduling analysis

Multi-core real-time scheduling

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

Real-Time Operating Systems for MPSoCs

Processes and Non-Preemptive Scheduling. Otto J. Anshus

First-class User Level Threads

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

Chapter 2: OS Overview

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

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

Threads Scheduling on Linux Operating Systems

Replication on Virtual Machines

Operating Systems. III. Scheduling.

Real-time KVM from the ground up

PikeOS: Multi-Core RTOS for IMA. Dr. Sergey Tverdyshev SYSGO AG , Moscow

Completely Fair Scheduler and its tuning 1

Understanding Linux on z/vm Steal Time

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

FlexPath Network Processor

Real Time Scheduling Basic Concepts. Radek Pelánek

Tasks Schedule Analysis in RTAI/Linux-GPL

Transcription:

Reliable Software Technology p. 1/26 Dispatching Domains for Multiprocessor Platforms and their Representation in Ada Alan Burns and Andy Wellings

Reliable Software Technology p. 2/26 Motivation Multiprocessor and multicore platforms are becoming widespread For real-time systems the control of affinities is as important as the control of priorities Ada05 allows, but does not support, multiprocessor execution

Reliable Software Technology p. 3/26 Contents of Talk Background Scheduling State of Art Basic support Current definition of support Example Conclusions

Reliable Software Technology p. 4/26 Background Identical, homogeneous, symmetric processors - SMPs, MPSoCs Assume basic OS support Ideas developed at IRTAW14 thanks to all participants Proposal focused by ARG Presentation matches current proposal not paper!

Reliable Software Technology p. 5/26 Scheduling State of Art Single processor scheduling is well understood Fixed Priority and EDF are mature technologies and supported by Ada Multiprocessor state of art much less certain For example: EDF is not an optimal scheme Rate/Deadline monotonic priority ordering is not optimal

Reliable Software Technology p. 6/26 Multiprocessor Scheduling Two basic approaches: 1. Partitioned allocate all tasks to particular processors 2. Global allow tasks to migrate during execution. Partitioning is really bin packing followed by single processor scheduling Global is potentially more effective, but increased overheads, probably does not scale and many open research questions

Reliable Software Technology p. 7/26 Basic Model Want to support partitioned and controlled global scheduling A fully flexible model is not justified at this time View all CPUs as a sequence 1..Number_Of_CPUs (not a set) Define Dispatching Domains to be slice of this sequence

Reliable Software Technology p. 8/26 Example 16 CPUs, denoted by 1..16 4 Dispatching Domains: 1..4, 5..8, 9..12 & 13..16, or 3 Domains: 1..1, 2..12, 13..16

Reliable Software Technology p. 9/26 Dispatching Domains All CPUs must be in exactly one Dispatching Domain All tasks (essentially) fixed to a single domain A task many be globally scheduling within its domain (can run on any CPU from within the domain), or A task can be fixed to just one CPU

Reliable Software Technology p. 10/26 Language Model Need to representing CPUs and Dispatching Domains Ideally these are done before any tasks execute But Ada s model of computation does not allow this pre-execution phase So a means of creating dispatching domains must be provided, and There needs to be a default initial domain for the environmental task.

Reliable Software Technology p. 11/26 Language Model In this talk: 1. CPUs are just ordered integers ie not sets 2. Dispatching Domains are slices 3. All dispatching domains have the same dispatching policies 4. Interrupts may also have infinities 5. Simpler than the model in the paper

Reliable Software Technology p. 12/26 Representing CPUs package System.Multiprocessors is pragma Preelaborate; type CPU_Range is range 0.. <implementation-defined>; Not_A_Specific_CPU : constant CPU_Range := 0; subtype CPU is CPU_Range range 1.. CPU_Range last; function Number_Of_CPUs return CPU; -- always returns the same value end System.Multiprocessors;

Reliable Software Technology p. 13/26 Representing DDs with Ada.Real_Time; package System.Multiprocessors.Dispatching_Domains is pragma Preelaborate; Dispatching_Domain_Error : exception; type Dispatching_Domain is private; System_Dispatching_Domain : constant Dispatching_Domain; function Create(First,Last : CPU) return Dispatching_Domain; function Get_First_CPU(DD : Dispatching_Domain) return CPU; function Get_Last_CPU(DD : Dispatching_Domain) return CPU;

Reliable Software Technology p. 14/26 Representing DDs function Get_Dispatching_Domain(T : Task_Id := Current_Task) return Dispatching_Domain; procedure Assign_Task( DD : in out Dispatching_Domain; P : in CPU_Range; T : in Task_Id := Current_Task); procedure Set_CPU(P:CPU_Range; T : Task_Id := Current_Task); function Get_CPU(T:Task_Id := Current_Task) return CPU_Range; procedure Delay_Until_And_Set_CPU( Delay_Until_Time : in Ada.Real_Time.Time; P : in CPU_Range); private -- not defined by the language end System.Multiprocessors.Dispatching_Domains;

Reliable Software Technology p. 15/26 Pragmas pragma CPU (expression); pragma Dispatching_Domain (expression);

Reliable Software Technology p. 16/26 Ravenscar 1. No use of dispatching domains 2. All tasks statically partitioned 3. Task make use of pragma CPU 4. Each processor is advised to have its own set of ready queues

Reliable Software Technology p. 17/26 Interrupt Affinities function Get_CPU(I: Interrupt_Id) return CPU_Range; -- The function Get_CPU returns the processor on which the -- handler for I is executed. -- If the handler can execute on more than one processor the -- value Not_A_Specific_CPU is returned.

Reliable Software Technology p. 18/26 Protected Objects Care must be taken with ceilings Real locks are needed Deadlocks etc are possible Execute PO code non-preemptively is one effective model

Reliable Software Technology p. 19/26 Example First using default dispatching domain A task executes on CPU 1 for this first 1.7ms, with a deadline of 5ms It then executed on CPU 2 with a deadline of 20ms Scheduling is via EDF Uses a Timer to switch CPUs

Reliable Software Technology p. 20/26 PO Spec. protected Switcher is procedure Register(ID : Task_ID; E : Time_Span); procedure Handler(TM :in out Timer); private Client : Task_ID; Extended_Deadline : Time_Span; end Switcher;

Reliable Software Technology p. 21/26 Task Spec. task Split is pragma Relative_Deadline(Milliseconds(5)); pragma Priority (15); -- computed from deadline of task pragma CPU(1); pragma Dispatching_Domain(System_Dispatching_Domain); end Split.

Reliable Software Technology p. 22/26 PO Body protected body Switcher is procedure Register(ID : Task_ID; E : Time_Span) is begin Client := ID; Extended_Deadline := E; end Register;

Reliable Software Technology p. 23/26 PO Body procedure Handler(TM :in out Timer) is New_Deadline : Deadline; begin New_Deadline := Get_Deadline(Client); Set_Deadline(New_Deadline + Extended_Deadline,Client); -- extends deadline by fixed amount passed in as E Set_CPU(2,Client); end Handler; end Switcher;

Reliable Software Technology p. 24/26 Task Body task body Split is ID : Task_ID := Current_Task; Switch : Timer(ID Access); Next : Time; First_Phase : Time_Span := Microseconds(1700); Period : Time_Span := Milliseconds(20); -- equal to full deadline First_Deadline : Time_Span := Milliseconds(5); Temp : Boolean; begin Switcher.Register(ID,Period-First_Deadline); Next := Ada.Real_Time.Clock;

Reliable Software Technology p. 25/26 Task Body loop Switch.Set_Handler(First_Phase,Switcher.Handler Access); -- code of application Next := Next + Period; Switch.Cancel_Handler(Temp); -- to cope with task -- completing early (ie < 1.7ms) Set_Deadline(Next+First_Deadline); Delay_Until_And_Set_CPU(Next,1); end loop end Split;

Reliable Software Technology p. 26/26 Conclusions Historically, Ada has always taken a neutral position on multiprocessor implementations. On the one hand, it tries to define its semantics so that they are valid on a multiprocessor. On the other hand, it provides no direct support for allowing a task set to be partitioned. This talk has presented a set of facilities that is being considered for Ada2012.