Integrating Cache Related Preemption Delay Analysis into EDF Scheduling

Similar documents
Integrating Cache Related Pre-emption Delay Analysis into EDF Scheduling

Design and Analysis of Time-Critical Systems Response-time Analysis with a Focus on Shared Resources

Cache related pre-emption delay aware response time analysis for fixed priority pre-emptive systems

Timing analysis and predictability of architectures

Cache Related Preemption Delay for Set-Associative Caches

Probabilistic Preemption Control using Frequency Scaling for Sporadic Real-time Tasks

EDF Scheduling. Giuseppe Lipari May 11, Scuola Superiore Sant Anna Pisa

Exact speedup factors and sub-optimality for non-preemptive scheduling

EDF Scheduling. Giuseppe Lipari CRIStAL - Université de Lille 1. October 4, 2015

Real-Time Scheduling and Resource Management

RUN-TIME EFFICIENT FEASIBILITY ANALYSIS OF UNI-PROCESSOR SYSTEMS WITH STATIC PRIORITIES

Schedulability Analysis for the Abort-and-Restart (AR) Model

A New Sufficient Feasibility Test for Asynchronous Real-Time Periodic Task Sets

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

Accurate Estimation of Cache-Related Preemption Delay

Andrew Morton University of Waterloo Canada

Limited Pre-emptive Global Fixed Task Priority

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Analysis of Preemptively Scheduled Hard Real-Time Systems

EDF Feasibility and Hardware Accelerators

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

Probabilistic Schedulability Analysis for Fixed Priority Mixed Criticality Real-Time Systems

Multiprocessor Scheduling II: Global Scheduling. LS 12, TU Dortmund

The Concurrent Consideration of Uncertainty in WCETs and Processor Speeds in Mixed Criticality Systems

Real-time scheduling of sporadic task systems when the number of distinct task types is small

Modeling Fixed Priority Non-Preemptive Scheduling with Real-Time Calculus

Non-Work-Conserving Non-Preemptive Scheduling: Motivations, Challenges, and Potential Solutions

Multiprocessor Scheduling I: Partitioned Scheduling. LS 12, TU Dortmund

Analysis and Implementation of Global Preemptive Fixed-Priority Scheduling with Dynamic Cache Allocation*

Uniprocessor Mixed-Criticality Scheduling with Graceful Degradation by Completion Rate

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas February 11, 2014

Preemption Delay Analysis for Floating Non-Preemptive Region Scheduling

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

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

Probabilistic Analysis for Mixed Criticality Systems using Fixed Priority Preemptive Scheduling

Probabilistic Analysis for Mixed Criticality Systems using Fixed Priority Preemptive Scheduling

Bounding the Maximum Length of Non-Preemptive Regions Under Fixed Priority Scheduling

FPCL and FPZL Schedulability Analysis

Worst-case response time analysis of real-time tasks under fixed-priority scheduling with deferred preemption revisited

Task Models and Scheduling

There are three priority driven approaches that we will look at

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

A New Task Model and Utilization Bound for Uniform Multiprocessors

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

Dependency Graph Approach for Multiprocessor Real-Time Synchronization. TU Dortmund, Germany

On-line scheduling of periodic tasks in RT OS

Schedulability and Optimization Analysis for Non-Preemptive Static Priority Scheduling Based on Task Utilization and Blocking Factors

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

Preemption points placement for sporadic task sets

Schedulability analysis of global Deadline-Monotonic scheduling

Real-time Systems: Scheduling Periodic Tasks

Lecture: Workload Models (Advanced Topic)

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

Global mixed-criticality scheduling on multiprocessors

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

Partitioned scheduling of sporadic task systems: an ILP-based approach

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

Embedded Systems 23 BF - ES

Probabilistic Analysis for Mixed Criticality Scheduling with SMC and AMC

Multiprocessor Scheduling of Age Constraint Processes

Rate-monotonic scheduling on uniform multiprocessors

Bounding the End-to-End Response Times of Tasks in a Distributed. Real-Time System Using the Direct Synchronization Protocol.

Lightweight Real-Time Synchronization under P-EDF on Symmetric and Asymmetric Multiprocessors

A Note on Modeling Self-Suspending Time as Blocking Time in Real-Time Systems

Priority-driven Scheduling of Periodic Tasks (1) Advanced Operating Systems (M) Lecture 4

Efficient TDM-based Arbitration for Mixed-Criticality Systems on Multi-Cores

An Improved Schedulability Test for Uniprocessor. Periodic Task Systems

Embedded Systems 14. Overview of embedded systems design

Controlling Preemption for Better Schedulability in Multi-Core Systems

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas January 24, 2014

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

Predictability of Least Laxity First Scheduling Algorithm on Multiprocessor Real-Time Systems

Time and Schedulability Analysis of Stateflow Models

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Supplement of Improvement of Real-Time Multi-Core Schedulability with Forced Non- Preemption

Modeling and Analysis of Engine Control Tasks Under Dynamic Priority Scheduling

CycleTandem: Energy-Saving Scheduling for Real-Time Systems with Hardware Accelerators

Schedulability Analysis for the Abort-and-Restart Model

Multiprocessor EDF and Deadline Monotonic Schedulability Analysis

Bounding and Shaping the Demand of Mixed-Criticality Sporadic Tasks

Segment-Fixed Priority Scheduling for Self-Suspending Real-Time Tasks

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

The preemptive uniprocessor scheduling of mixed-criticality implicit-deadline sporadic task systems

Reducing Tardiness Under Global Scheduling by Splitting Jobs

On the Soft Real-Time Optimality of Global EDF on Multiprocessors: From Identical to Uniform Heterogeneous

arxiv: v1 [cs.os] 25 May 2011

Complexity of Uniprocessor Scheduling Analysis

Real-Time and Embedded Systems (M) Lecture 5

arxiv: v1 [cs.os] 6 Jun 2013

MIRROR: Symmetric Timing Analysis for Real-Time Tasks on Multicore Platforms with Shared Resources

Reducing Tardiness Under Global Scheduling by Splitting Jobs

An Improved Schedulability Test for Uniprocessor Periodic Task Systems

A Framework for Automated Competitive Analysis of On-line Scheduling of Firm-Deadline Tasks

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Improved Priority Assignment for the Abort-and-Restart (AR) Model

Contention-Free Executions for Real-Time Multiprocessor Scheduling

CSE 380 Computer Operating Systems

Task assignment in heterogeneous multiprocessor platforms

Lightweight Real-Time Synchronization under P-EDF on Symmetric and Asymmetric Multiprocessors

Transcription:

Integrating Cache Related Preemption Delay Analysis into EDF Scheduling Will Lunniss 1 Sebastian Altmeyer 2 Claire Maiza 3 Robert I. Davis 1 1 Real-Time Systems Research Group, University of York, UK {wl510, rob.davis}@york.ac.uk 2 Department of Computer Science, Saarland University, Germany altmeyer@cs.uni-sb.de 2 Verimag, Grenoble INP, Grenoble, France Claire.maiza@imag.fr 1

Outline EDF Scheduling CRPD Integrating CRPD analysis into EDF Comparison with existing approach Improved CRPD analysis Case study Synthetic taskset evaluation Conclusions 2

Earliest Deadline First (EDF) It is dynamic scheduling algorithm Schedules the job of the task with the earliest absolute deadline first Proven to be optimal by Dertouzos on a single core processor 3

Determining which job should run 4

Determining which job should run If two jobs have the same absolute deadline We assume that the job with the lowest task index is chosen E.g. τ 2 pre-empts τ 3 in the above example 4

Determining which job should run If two jobs have the same absolute deadline Ensures that two tasks cannot pre-empt each other Ensures that after a pre-emption, the task that was pre-empted last is resumed first E.g τ 2 is resumed at t = 7 5

Determining which job should run If two jobs have the same absolute deadline Ensures that two tasks cannot pre-empt each other Ensures that after a pre-emption, the task that was pre-empted last is resumed first E.g τ 2 is resumed at t = 7, rather than τ 3 5

Determining which job should run Also applies for jobs with the same relative deadline and release time E.g. τ 2 is resumed at t = 3, rather than τ 3 starting 6

Determining which job should run Also applies for jobs with the same relative deadline and release time E.g. τ 2 is resumed at t = 3, rather than τ 3 starting 6

Determining which job should run Also applies for jobs with the same relative deadline and release time E.g. τ 2 is resumed at t = 3, rather than τ 3 starting 7

Schedulability test If all tasks have implicit deadlines (D i =T i ), schedulability test is 8

Schedulability test If all tasks have implicit deadlines (D i =T i ), schedulability test is U 1 8

Schedulability test If all tasks have implicit deadlines (D i =T i ), schedulability test is U 1 If D i T i then the test is still necessary, but is no longer sufficient 8

Schedulability test If all tasks have implicit deadlines (D i =T i ), schedulability test is U 1 If D i T i then the test is still necessary, but is no longer sufficient Need to do another test 8

Processor demand bound function h( t) i1 t D max0,1 Ti i C i 9

Processor demand bound function h( t) i1 t D max0,1 Ti i C i Sum over each task 9

Processor demand bound function h( t) i1 t D max0,1 Ti i C i Sum over each task the number of jobs a task has which are released and have their deadlines in the interval t 9

Processor demand bound function h( t) i1 t D max0,1 Ti i C i Sum over each task the number of jobs a task has which are released and have their deadlines in the interval t multiplied by the tasks execution time 9

Processor demand bound function h( t) i1 t D max0,1 Ti i C i Sum over each task the number of jobs a task has which are released and have their deadlines in the interval t multiplied by the tasks execution time S. K. Baruah, L. E. Rosier, and R. R. Howell, "Algorithms and Complexity Concerning the Preemptive Scheduling of Periodic Real-Time Tasks on One Processor," Real-Time Systems, vol. 2, no. 4, pp. 301-324, 1990 9

Schedulability test A taskset is schedulable iff h(t) t for all values of t The execution time requirement must be less than or equal to the available time 10

Schedulability test A taskset is schedulable iff h(t) t for all values of t The execution time requirement must be less than or equal to the available time h(t) can only change when t is equal to an absolute deadline Bound the maximum value of t, L, using either Hyper-period: Least common multiple of task periods Synchronous busy period 10

Schedulability test There are still a large number of values for t that need to be checked 11

Schedulability test There are still a large number of values for t that need to be checked Can be reduced by using the Quick convergence Processor-demand Analysis (QPA) algorithm by Zhang and Burns Starts with a value of t close to L Iterates back towards 0 checking a significantly smaller number of values 11

Schedulability test There are still a large number of values for t that need to be checked Can be reduced by using the Quick convergence Processor-demand Analysis (QPA) algorithm by Zhang and Burns Starts with a value of t close to L Iterates back towards 0 checking a significantly smaller number of values F. Zhang and A. Burns, "Schedulability Analysis for Real-Time Systems with EDF Scheduling," IEEE Transactions on Computers, vol. 58, no. 9, pp. 1250-1258, September 2009 11

Pre-emptions and Cache Related Pre-empt Delays (CRPD) 12

Pre-emptions and Cache Related Pre-empt Delays (CRPD) Pre-empting task can evict blocks belonging to the pre-empted task CRPD are introduced when the pre-empted task has to reload some of those evicted cache blocks after resuming 12

Cache block categorisation Evicting Cache Blocks (ECBs) Loaded into cache and can therefore evict other blocks 13

Cache block categorisation Evicting Cache Blocks (ECBs) Loaded into cache and can therefore evict other blocks Useful Cache Blocks (UCBs) Reused once they have been loaded into cache before potentially being evict by the task If evicted by another task, they may have to be reloaded which introduces CRPD UCBs are always ECBs 13

Cache block categorisation Example block classification 14

Cache block categorisation Example block classification Instructions inside loops are often UCBs as they get reused 14

CRPD analysis Need to calculate the number of blocks evicted during a pre-emption that must be reloaded Multiply by the cost to reload each block, BRT 15

CRPD analysis Need to calculate the number of blocks evicted during a pre-emption that must be reloaded Multiply by the cost to reload each block, BRT Could take a simple approach and assume every block evicted by a pre-empting task must be re-loaded e.g. BRT t, j ECB j 15

CRPD analysis Adapted a number of approaches for FP to work with EDF Defined: the sets of tasks which can/cannot pre-empt each other how often these pre-emptions can occur within the interval t 16

CRPD analysis Adapted a number of approaches for FP to work with EDF Defined: the sets of tasks which can/cannot pre-empt each other how often these pre-emptions can occur within the interval t Then include the CRPD into the h(t) calculation 16

Integrating CRPD analysis into the h(t) calculation n t D j h( t) max0,1 C j t j1 Tj, j 17

Integrating CRPD analysis into the h(t) calculation Calculate the CRPD caused by one job of task τ j in the interval t n t D j h( t) max0,1 C j t j1 Tj, j 17

Integrating CRPD analysis into the h(t) calculation Calculate the CRPD caused by one job of task τ j in the interval t n t D j h( t) max0,1 C j t j1 Tj, j Then add it to the execution time of that job of task τ j 17

Effect of CRPD on task utilisation and h(t) calculation The analysis effectively increases the execution time of a task by the CRPD it causes Need to account for this when calculating the utilisation of a task and taskset Also need to use this when calculating the upper bound of t used for calculating h(t) 18

Set of pre-empting tasks Based on the tasks relative deadline Assume that any task τ j with a relative deadline D j < D i can pre-empt task τ i 19

Set of pre-empting tasks Based on the tasks relative deadline Assume that any task τ j with a relative deadline D j < D i can pre-empt task τ i The set of tasks that can pre-empt task τ i is: 19

Set of pre-empting tasks Based on the tasks relative deadline Assume that any task τ j with a relative deadline D j < D i can pre-empt task τ i The set of tasks that can pre-empt task τ i is: hp( i) { j D j Di } 19

Set of pre-empted tasks Task τ j can pre-empt any tasks whose relative deadline is greater than it s relative deadline 20

Set of pre-empted tasks Task τ j can pre-empt any tasks whose relative deadline is greater than it s relative deadline Can exclude all tasks whose relative deadlines are greater than t They do not need to be included when calculating h(t), see paper for proof 20

Set of pre-empted tasks Task τ j can pre-empt any tasks whose relative deadline is greater than it s relative deadline Can exclude all tasks whose relative deadlines are greater than t They do not need to be included when calculating h(t), see paper for proof aff t, j i t Di D j 20

UCB-Union Based on approach by Tan and Mooney ucbu t, j BRT UCBk kaff( t, j) ECB j 21

UCB-Union Based on approach by Tan and Mooney ucbu t, j BRT UCBk kaff( t, j) ECB j 21

UCB-Union Based on approach by Tan and Mooney ucbu t, j BRT UCBk kaff( t, j) ECB j Calculate the union of the UCBs of all tasks that: can be evicted by the pre-empting task τ j have a job with a release time and absolute deadline within the interval t 21

UCB-Union Based on approach by Tan and Mooney ucbu t, j BRT UCBk kaff( t, j) ECB j Calculate the union of the UCBs of all tasks that: can be evicted by the pre-empting task τ j have a job with a release time and absolute deadline within the interval t intersected with the ECBs of the pre-empting task 21

UCB-Union Based on approach by Tan and Mooney ucbu t, j BRT UCBk kaff( t, j) ECB j Calculate the union of the UCBs of all tasks that: can be evicted by the pre-empting task τ j have a job with a release time and absolute deadline within the interval t intersected with the ECBs of the pre-empting task Y. Tan and V. Mooney, "Timing Analysis for Preemptive Multitasking Real-Time Systems with Caches," ACM Transactions on Embedded Computing Systems (TECS), vol. 6, no. 1, February 2007. 21

ECB-Union Based on the approach by Altmeyer et al. UCB ecbu t, j BRT max k kaff( t, j) hhp( j) { j} ECB h 22

ECB-Union Based on the approach by Altmeyer et al. UCB ecbu t, j BRT max k kaff( t, j) hhp( j) { j} ECB h Assume that task τ j has already been pre-empted. Include the union of ECBs belonging to all tasks that can pre-empt it 22

ECB-Union Based on the approach by Altmeyer et al. UCB ecbu t, j BRT max k kaff( t, j) hhp( j) { j} ECB h Assume that task τ j has already been pre-empted. Include the union of ECBs belonging to all tasks that can pre-empt it 22

ECB-Union Based on the approach by Altmeyer et al. UCB ecbu t, j BRT max k kaff( t, j) hhp( j) { j} ECB h Calculate the maximum number of UCBs that may need to be reloaded by any task that is directly pre-empted by task τ j Assume that task τ j has already been pre-empted. Include the union of ECBs belonging to all tasks that can pre-empt it 22

ECB-Union Based on the approach by Altmeyer et al. UCB ecbu t, j BRT max k kaff( t, j) hhp( j) { j} ECB h Calculate the maximum number of UCBs that may need to be reloaded by any task that is directly pre-empted by task τ j Assume that task τ j has already been pre-empted. Include the union of ECBs belonging to all tasks that can pre-empt it S. Altmeyer, R.I. Davis, and C. Maiza, "Cache Related Pre-emption Delay Aware Response Time Analysis for Fixed Priority Pre-emptive Systems," in Proceedings of the 32nd IEEE Real-Time Systems Symposium (RTSS), Vienna, Austria, 2011, pp. 261-271. 22

Existing approach In 2007, Ju et al. presented an approach We refer to it as the JCR approach after their initials jcr i BRT P j jhp( i) ( D i ) UCB i ECB j 23

Existing approach In 2007, Ju et al. presented an approach We refer to it as the JCR approach after their initials jcr i BRT P j jhp( i) ( D i ) UCB i ECB j Sum for every task τ j that can pre-empt task τ i 23

Existing approach In 2007, Ju et al. presented an approach We refer to it as the JCR approach after their initials jcr i BRT P j jhp( i) ( D i ) UCB i ECB j Sum for every task τ j that can pre-empt task τ i the number of times task τ j can pre-empt a single job of task τ i 23

Existing approach In 2007, Ju et al. presented an approach We refer to it as the JCR approach after their initials jcr i BRT P j jhp( i) ( D i ) UCB i ECB j Sum for every task τ j that can pre-empt task τ i the number of times task τ j can pre-empt a single job of task τ i multiplied with the number of task τ i UCBs that could be evicted task τ j ECBs 23

Existing approach In 2007, Ju et al. presented an approach We refer to it as the JCR approach after their initials jcr i BRT P j jhp( i) ( D i ) UCB i ECB j Sum for every task τ j that can pre-empt task τ i the number of times task τ j can pre-empt a single job of task τ i multiplied with the number of task τ i UCBs that could be evicted task τ j ECBs Ju, S. Chakraborty, and A. Roychoudhury, "Accounting for Cache-Related Preemption Delay in Dynamic Priority Schedulability Analysis," in Design, Automation and Test in Europe Conference and Exposition (DATE), Nice, France, 2007, pp. 1623-1628 23

Existing approach Can be pessimistic for nested pre-emptions Calculates the cost between each pair of tasks 24

Existing approach Can be pessimistic for nested pre-emptions Calculates the cost between each pair of tasks If pre-empting tasks have ECBs located in the same cache sets, they will be counted multiple times More likely when there the cache utilisation is high 24

Existing approach Can be pessimistic for nested pre-emptions Calculates the cost between each pair of tasks If pre-empting tasks have ECBs located in the same cache sets, they will be counted multiple times More likely when there the cache utilisation is high It is incomparable to the approaches we have presented so far 24

Improved CRPD analysis The UCB-Union and ECB-Union approach can be pessimistic They assume intermediate tasks are pre-empted the same number of times as the pre-empted task 25

Improved CRPD analysis E.g. the cost of τ 2 pre-empting task τ 3 is counted three times rather than once 26

Improved CRPD analysis E.g. the cost of τ 2 pre-empting task τ 3 is counted three times rather than once 26

Multiset approaches ECB-Union Multiset and UCB-Union Multiset Factor in the number of times that intermediate tasks pre-empt the pre-empted task to tighten the bound See paper for details 27

Comparison of approaches 28

Comparison of approaches 28

Comparison of approaches 28

Comparison of approaches 28

Comparison of approaches 28

Case study Based on a code from the Mälardalen benchmark suite to create a 15 task taskset Setup to model an ARM7 10MHz CPU 2KB direct-mapped instruction cache Line size of 8 Bytes, 4 Byte instructions, 256 cache sets Block reload time of 8μs 29

Case study Breakdown utilisation No pre-emption cost 1 Combined Multiset 0.659 ECB-Union Multiset 0.659 UCB-Union Multiset 0.594 ECB-Union 0.612 UCB-Union 0.583 UCB-Only 0.462 ECB-Only 0.364 JCR 0.488 30

Synthetic tasksets 10 tasks per taskset 10,000 tasksets for baseline evaluation 512 cache sets Cache utilisation of 5 Maximum UCB percentage of 30% 31

Baseline evaluation 32

Baseline evaluation 32

Baseline evaluation Combined multiset approach outperforms all other approaches Including the existing approach 32

Baseline evaluation Weighted Schedulability No pre-emption cost 1 Combined Multiset 0.528 ECB-Union Multiset 0.501 UCB-Union Multiset 0.455 ECB-Union 0.481 UCB-Union 0.427 UCB-Only 0.416 ECB-Only 0.236 JCR 0.333 33

Baseline evaluation Weighted Schedulability No pre-emption cost 1 Combined Multiset 0.528 ECB-Union Multiset 0.501 UCB-Union Multiset 0.455 ECB-Union 0.481 UCB-Union 0.427 UCB-Only 0.416 ECB-Only 0.236 JCR 0.333 33

Varying Cache Utilisation 34

Varying Cache Utilisation 34

Varying Cache Utilisation 34

Varying Maximum UCB Percentage 35

Varying Maximum UCB Percentage 35

Varying Maximum UCB Percentage 35

Varying Number of Tasks 36

Conclusion Presented new CRPD aware analysis for EDF Combined multiset approach dominates the existing approach by Ju et al. Confirmed via evaluation/simulation Detailed study shows the strengths and weaknesses of the different approaches We plan to investigate which is better, FP or EDF, when taking into account CRPD 37

Thank you for listening Any Questions? 38