Multi-core real-time scheduling

Similar documents
Analysis and Simulation of Scheduling Techniques for Real-Time Embedded Multi-core Architectures

Aperiodic Task Scheduling

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

Master thesis. Title: Real-Time Scheduling methods for High Performance Signal Processing Applications on Multicore platform

Priority-Driven Scheduling

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

Real Time Scheduling Basic Concepts. Radek Pelánek

Scheduling Real-time Tasks: Algorithms and Complexity

Sustainable Multiprocessor Real-Time Scheduling with Exact Preemption Cost

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

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

Grant Agreement FP7-ICT

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

Lecture 3 Theoretical Foundations of RTOS

Common Approaches to Real-Time Scheduling

Periodic Task Scheduling

The simple case: Cyclic execution

The Relative Worst Order Ratio for On-Line Algorithms

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

Real- Time Scheduling

Chapter 3: Planning and Scheduling

Global Multiprocessor Real-Time Scheduling as a Constraint Satisfaction Problem

Embedded Systems 20 BF - ES

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

Embedded Systems 20 REVIEW. Multiprocessor Scheduling

Fair Scheduling of Real-time Tasks on Multiprocessors

Partitioned EDF Scheduling for Multiprocessors using a C=D Scheme

Scheduling Theory of Real-Time Schematics

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

Scheduling Algorithms for Real-Time Systems

Scheduling Sporadic Tasks with Shared Resources in Hard-Real-Time Systems

Cache-aware compositional analysis of real-time multicore virtualization platforms

Predictable response times in event-driven real-time systems

Compositional Real-Time Scheduling Framework with Periodic Model

Off-line Optimal Multiprocessor Scheduling of Dependent Periodic Tasks

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

ICS Principles of Operating Systems

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

Integrating job parallelism in real-time scheduling theory

Aperiodic Task Scheduling

Sustainability in Real-time Scheduling

Exercises : Real-time Scheduling analysis

DP-FAIR: A Simple Model for Understanding Optimal Multiprocessor Scheduling

An Optimal Real-Time Scheduling Algorithm for Multiprocessors

HYBRID GENETIC ALGORITHMS FOR SCHEDULING ADVERTISEMENTS ON A WEB PAGE

Multicore scheduling in automotive ECUs

4. Fixed-Priority Scheduling

Partition Scheduling in APEX Runtime Environment for Embedded Avionics Software

CHAPTER 4: SOFTWARE PART OF RTOS, THE SCHEDULER

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Commonly Used Approaches to Real-Time Scheduling

Cache-Aware Compositional Analysis of Real-Time Multicore Virtualization Platforms

Dynamic Memory Management for Embedded Real-Time Systems

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

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

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

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Real-Time Multi-Core Virtual Machine Scheduling in Xen

Improvement of Scheduling Granularity for Deadline Scheduler

Real-Time Multi-Core Virtual Machine Scheduling in Xen

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

Methods and Tools For Embedded Distributed System Scheduling and Schedulability Analysis

Real-time scheduling algorithms, task visualization

Classification - Examples

Modular Real-Time Linux

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

Effective Scheduling Algorithm and Scheduler Implementation for use with Time-Triggered Co-operative Architecture

Efficient and Robust Allocation Algorithms in Clouds under Memory Constraints

Introducción a Calendarización en Sistemas Paralelas, Grids y Nubes

RUN: Optimal Multiprocessor Real-Time Scheduling via Reduction to Uniprocessor

Efficient Scheduling Of On-line Services in Cloud Computing Based on Task Migration

Real-Time Operating Systems for MPSoCs

On-line Scheduling of Real-time Services for Cloud Computing

Lec. 7: Real-Time Scheduling

Real-Time Scheduling 1 / 39

A Tool for Generating Partition Schedules of Multiprocessor Systems

Efficient overloading techniques for primary-backup scheduling in real-time systems

Scheduling Algorithms For Fault-Tolerant Real-Time Systems

Periodic Real-Time Scheduling for FPGA Computers

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Dimensioning an inbound call center using constraint programming

Hardware Task Scheduling and Placement in Operating Systems for Dynamically Reconfigurable SoC

Semi-Partitioned Hard-Real-Time Scheduling Under Locked Cache Migration in Multicore Systems

Embedded Systems. 6. Real-Time Operating Systems

ChronOS Linux: A Best-Effort Real-Time Multiprocessor Linux Kernel

On the Scalability of Real-Time Scheduling Algorithms on Multicore Platforms: A Case Study

Ada Real-Time Services and Virtualization

A Constant-Approximate Feasibility Test for Multiprocessor Real-Time Scheduling

Scheduling Imprecise Tasks in Real-Time Distributed Systems

A Real-Time Scheduling Service for Parallel Tasks

iems for Large Scale Charging of Electric Vehicles: Architecture and Optimal Online Scheduling

Using EDF in Linux: SCHED DEADLINE. Luca Abeni

Real- Time Mul,- Core Virtual Machine Scheduling in Xen

Quantum Support for Multiprocessor Pfair Scheduling in Linux

Scheduling Shop Scheduling. Tim Nieberg

Cloud Storage and Online Bin Packing

Partitioned real-time scheduling on heterogeneous shared-memory multiprocessors

Cloud Management: Knowing is Half The Battle

Scheduling Single Machine Scheduling. Tim Nieberg

N. Audsley. A. Burns Department of Computer Science, University of York, UK. ABSTRACT

Transcription:

Multi-core real-time scheduling Credits: Anne-Marie Déplanche, Irccyn, Nantes (many slides come from her presentation at ETR, Brest, September 2011) 1 Multi-core real-time scheduling! Introduction: problem definition and classification! Some anomalies of multiprocessor scheduling! Model and assumptions! Extension of uni-processor scheduling strategies! Pfair approaches Real Time Systems 2012-2013 2

Introduction! Mono-processor scheduling: one-dimension problem " Temporal organization When to start, interrupt, resume every task? n tasks? Time 1 processor Real Time Systems 2012-2013 3 Introduction! Multi-processor (multi-core) scheduling: twodimension problem " Temporal organization + " Spatial organization On which processor execute every task? n tasks t? t m processors T4 t Real Time Systems 2012-2013 4

Classification! Partitioned scheduling " Each of the two dimensions is dealt with separately! Global scheduling " Temporal and spatial dimensions are deal with jointly! Semi-partitioned scheduling " Hybrid Real Time Systems 2012-2013 5 Classification: partitioned scheduling! Each of the two dimensions is dealt with separately " Spatial organization: the n tasks are partitioned onto the m cores. No task migration at run-time " Temporal organization: Mono-processor scheduling is used on each core C1? T4 t C2? t Real Time Systems 2012-2013 6

Classification: partitioned scheduling! Two points of view " Number of processors to be determined: optimization problem (bin-packing problem) Bin = task, size = utilization (or other expression obtained from the task temporal parameters) Boxes = processors, size = ability to host tasks " Fixed number of processors: search problem (knapsack problem)! Both problems are NP-hard Real Time Systems 2012-2013 7 Classification: partitioned scheduling! Optimal mono-processor scheduling strategies: XX " RM, DM " EDF, LLF (see uni-processor scheduling chapter)! Bin-packing heuristics: YY " FF: First-Fit " BF: Best-Fit " WF: Worst-Fit, NF: Next-Fit " FFD, BFD, WFD: First/Best/Worst-Fit Decreasing! Partitioning algorithms XX-YY Real Time Systems 2012-2013 8

Classification: partitioned scheduling! Benefits " Implementation: local schedulers are independent " No migration costs " Direct reuse of mono-processor schedulability tests " Isolation between processors in case of overload! Limits " Rigid: suited to static configurations " NP-hard task partitioning " Largest utilization bound for any partitioning m +1 algorithm [Andersson, 2001] 2 (m+1 tasks of execution time 1+! and period 2) Real Time Systems 2012-2013 9! Classification: global scheduling! Temporal and spatial dimensions are dealt with jointly " Global unique scheduler and run queue " At each scheduling point, the scheduler decides when and where schedule at most m tasks " Task migration allowed t? t T4 t Real Time Systems 2012-2013 10

Classification: global scheduling! Benefits " Suited to dynamic configurations " Dominates all other scheduling policies (if unconstrained migrations + dyn. priorities see later) " Optimal schedulers exist " Overloads/underloads spread on all processors! Drawbacks " System overheads: migrations, mutual exclusion for sharing the run queue Real Time Systems 2012-2013 11 Classification: global scheduling! (Preemptive) global RM/DM/EDF: definition " Task priorities assigned according to RM/DM/EDF " Scheduling algorithm: the m higher priority tasks are executed on the m processors Real Time Systems 2012-2013 12

Classification: semi-partitioned scheduling! Partitioned scheduling as far as possible! Some statically determined tasks may migrate " Constraint: migrating tasks (T4 on the example) must execute on a single processor at a time C1? T4 t C2? T4 t Migrating task T4 Real Time Systems 2012-2013 13 Terminology! A task set is schedulable if there exists a scheduling policy such that all deadlines are met! A task set is schedulable by a scheduling policy if under that scheduling policy all deadlines are met! A scheduling policy is optimal if it is able to correctly schedule all schedulable task sets " Different from the optimality defined before! Utilization bound of a scheduling policy: utilization U lim below which all task sets meet their deadline Real Time Systems 2012-2013 14

Terminology! Priorities " Fixed per task (FTP) " Fixed per job (FJP) " Dynamic per job (DJP) Real Time Systems 2012-2013 15 Overview of global scheduling policies! Assumptions " Tasks Periodic tasks (Pi) Implicit deadlines (Di=Pi) Synchronous tasks (Oi=0 for all i) Independent tasks A single job of a task can be active at a time " Architecture Identical processors System costs are neglected (preemption, migration, scheduling policy) Real Time Systems 2012-2013 16

Scheduling anomalies (1/3)! Dhall s effect [Dhall & Liu, 1978] " Periodic task sets with utilization close to 1 are unschedulable using global RM / EDF " n = m+1, P i = 1, C i = 2!, u i =2! for all 1"i"m " P m+1 =1+!, C m+1 =1, u m+1 =1/(1+!) " Task m+1 misses its deadline although U very close to 1 T 1 T m 1 T m+1 0 2ε 1+ε Real Time Systems 2012-2013 17 Scheduling anomalies (2/3)! Period increase for periodic tasks and fixed priorities [Anderson, 2003] " n = 3, m=2, (P 1 = 3, C 1 =2), (P 2 =4,C 2 =2), (P 3 =12,C 3 =7) " Schedulable under global RM " If P 1 is increased to P 1 =4 and priorities stay the same, T 3 misses its deadline Real Time Systems 2012-2013 18

Scheduling anomalies (2/3)! (P 1 = 3, C 1 =2), (P 2 =4,C 2 =2), (P 3 =12,C 3 =7)! (P 1 = 4, C 1 =2), (P 2 =4,C 2 =2), (P 3 =12,C 3 =7) Real Time Systems 2012-2013 19 Scheduling anomalies (3/3)! Critical instant not necessarily the simultaneous release of higher priority tasks " n=3, m=2 " (P 1 =2, C 1 =1), (P 2 =3,C 2 =2), (P 3 =4,C 3 =2) " Under RM scheduling Response time of T 3 higher at time 4 than at time 0 3 4 Real Time Systems 2012-2013 20

General properties of multiprocessor scheduling (1/2)! Exact schedulability condition " U " m and u max " 1 " U = total utilization " U max = maximum utilization " Does not tell for which scheduling algorithm!! Schedule is cyclic on the hyperperiod H (PPCM(P i )) for: " Deterministic " Without memory scheduling algorithms Real Time Systems 2012-2013 21 General properties of multiprocessor scheduling (2/2)! Theorem [Srinavasan & Baruah, 2002] " Non existence of FJP (FJP+FTP) scheduling with utilization bound strictly larger than (m+1)/2 for implicit deadline periodic task sets Real Time Systems 2012-2013 22

Global multiprocessor scheduling: detailed outline! Transposition of uni-processor algorithms! Extensions of uni-processor algorithms " US (Utilization Threshold) " EDF(k) " ZL (Zero Laxity)! Pfair approaches (Proportional Fair) Real Time Systems 2012-2013 23 Transposition of uni-processor algorithms (1/2)! Main algorithms " RM (Rate Monotonic) # G-RM, Global RM " EDF (Earliest Deadline First) # G-EDF, Global EDF! Not optimal anymore! Sufficient schedulability tests (depend on u max ) G-RM u max " m/(3m-2) and U " m 2 /(3m-2) u max " 1/3 and U " m/3 U " m/2 * (1-u max ) + u max G-EDF u max " m/(2m+1) and U " m 2 /(2m+2) u max " 1/2 and U " (m+1)/2 U " m (m-1) u max Real Time Systems 2012-2013 24

Transposition of uni-processor algorithms (2/2) Real Time Systems 2012-2013 25 Extensions of global RM/EDF: US (Utilization Threshold) policies! Priority assignment depend on an utilization threshold # " If u i > #, then T i is assigned maximal priority " Else, T i s priority assigned as in original algorithm (RM/EDF) " Arbitrary deterministic tie resolution! Remarks " Still non optimal, " Outperforms the base policy " Defies Dhall s effect Real Time Systems 2012-2013 26

Extensions of global RM/EDF: US (Utilization Threshold) policies! Example: RM-US[#=1/2] Ci Pi Ui Prio 4 10 2/5 2 3 10 3/10 2 8 12 2/3 $ T4 5 12 5/12 1 T5 7 12 7/12 $ Real Time Systems 2012-2013 27 Extensions of global RM/EDF: US (Utilization Threshold) policies! Utilization bounds RM-US EDF-US #=m/(3m-2) U " m 2 /(3m-2) #=m/(2m-1) U " m 2 /(2m-1) #=1/3 U " (m+1)/3 #=1/2 U " (m+1)/2! Remarks " Utilization bounds do not depend on u max anymore " EDF-US[1/2] attains the best utilization bound possible for FJP Real Time Systems 2012-2013 28

Extensions of global RM/EDF: EDF(k)! Task indices by decreasing utilization " u i >= u i +1 for all i in [1,n]! Priority assignment depends on a threshold on task index " i < k, then maximum priority " Else, priority assignment according to original algorithm Real Time Systems 2012-2013 29 Extensions of global RM/EDF: EDF(k)! Example, EDF(4) Ci Pi Ui Prio 4 10 2/5 EDF 3 10 3/10 EDF 8 12 2/3 $ T4 5 12 5/12 $ T5 7 12 7/12 $ Real Time Systems 2012-2013 30

Extensions of global RM/EDF: EDF(k) % n ' & $ u i (! Sufficient schedulability test m " ( k #1) # & i=k +1 ( & 1 # u k ( & ( " k min = value minimizing right side of the equation " With k=k min, utilization bound of (m+1)/2 (best possible for FJP)! " Comparison with EDF[1/2] Same utilization bound EDF(k min ) dominates EDF[1/2] Real Time Systems 2012-2013 31 Extensions of global RM/EDF: ZL (Zero Laxity) policies! XX-ZL: apply policy XX until Zero Laxity " Maximal priority when laxity reaches zero (regardless of the currently running job), original priority assignment for the others " In category DJP (dynamic job scheduling)! Policies: EDZL [Lee, 1994], RMZL [Kato & al, 2009], FPZL [Davis et al, 2010]! Utilization bound: (m+1)/2! Dominates G-EDF Real Time Systems 2012-2013 32

Extensions of global RM/EDF: ZL (Zero Laxity) policies! Example: m=3,m=2; all Pi to 2, all Ci to 2 " G-EDF: misses its deadline " EDZL: OK Real Time Systems 2012-2013 33 Pfair algorithms! Principle! Construction of a Pfair schedule! Pfair scheduling policies Real Time Systems 2012-2013 34

Pfair algorithms: principle! Pfair: Proportionate Fair " [Baruah et al, 1996] " Allocate time slots to tasks as close as possible to a fluid system, proportional to their utilization factor! Example " C 1 =C 2 =3, P 1 =P 2 =6 (u 1 =u 2 =1/2) " Each task will be approximately allocated 1 slot out of 2 (whatever the processor) Real Time Systems 2012-2013 35 Pfair algorithms: principle! Lag function: difference between real and fluid execution! Lag " Discrete time, successive time slots [t,t+1[ " Weight of a task: % i =u i lag(t i,t) = " i t # " First term: fluid execution $ t #1 u=0 S(T i,u)! " Second term: real execution, with S(T i,u)=1 if T i executed in slot u, else 0! Pfair schedule: for all time t, lag in interval ]-1,1[ Real Time Systems 2012-2013 36

Pfair algorithms: principle! Example +/- 1 Execution domain of Pfair (slope ui) Real Time Systems 2012-2013 37 Pfair algorithms: principle! Property " If a Pfair schedule exists, deadlines are met! Exact test of existence of a Pfair schedule n " u i # m i=1 " Full processor utilization!! Real Time Systems 2012-2013 38

Pfair algorithms: construction of a Pfair schedule! Divide tasks in unity-length sub-tasks " Pfair condition: each subtask j executes in a time window between a pseudo-arrival and a pseudodeadline " Pseudo-arrival: $ r(t j i ) = j "1 & $ & % ' # i " Pseudo-deadline:! d(t i j ) = # $ j " i % & Real Time Systems 2012-2013 39! Pfair algorithms: construction of a Pfair schedule! Example (to be fixed) Real Time Systems 2012-2013 40

Pfair algorithms: scheduling algorithms! EPDF (Earliest Pseudo-Deadline First) " Apply EDF to pseudo-deadlines " Optimal only for m=2 (2 processors)! PF, PD, PD 2 " EPDF with non-arbitrary tie breaking rules in case of identical pseudo-deadlines " All of them are optimal " Most efficient one: PD 2! Ongoing works " Reduce numbers of context switches and migrations while maintaining optimality Real Time Systems 2012-2013 41 Conclusion! Multi-processor scheduling is an active research area! Ongoing works " Global multi-core scheduling " Semi-partitioned scheduling " Determining upper bounds of practical factors (preemption, migration, ) " Implementation in real-time operating systems Real Time Systems 2012-2013 42