Download presentation
Presentation is loading. Please wait.
Published byGiancarlo Flash Modified over 9 years ago
1
Explicit Preemption Placement for Real- Time Conditional Code via Graph Grammars and Dynamic Programming Bo Peng, Nathan Fisher, and Marko Bertogna Department of Computer Science, Wayne State University, USA Algorithmic Research Group, University of Modena, Italy 211 1 2 This research has been supported by US National Science Foundation and the European Commission.
2
Graph grammars; Dynamic programming. Optimize the WCET+CRPD of the flowgraphs. Series-parallel flowgraphs. Limited-preemption scheduling model in real -time code. 2 Outline Background Model Problem Statement Solution
3
3 Outline Background Model Problem Statement Conclude the presentation Solution
4
4 Introduction Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions WCET+CRPD analysis Real-time schedulability analysis Limited preemption scheduling Reduce WCET+CRPD
5
Write A Read A Write B5 Limited Preemption Scheduling Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions CRPD Cache evictions by preempting higher-priority tasks. Precise upper bounds on the cache-related preemption delays (CRPD). Delay the preemption to maintain a job's locality. Reduce WCET when arbitrarily preempt Cache TAG A B Cache eviction Cache reload
6
6 Limited Preemption Scheduling Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Precise upper bounds on the cache-related preemption delays (CRPD). Delay the preemption to maintain a job's locality. Reduce WCET when arbitrarily preempt Reduce CRPD via limited preemption while preserving system schedulability. Our goal
7
7 Related Work Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Fixed preemption point models Floating preemption point models EDF scheduled systems Burns ['94] Baruah ['05] Bertogna and Baruah ['10] Fixed Priority scheduled systems Burns ['94], Bril et al. ['09], Bertogna et al. ['11], Davis et al. ['12] Yao et al. ['09] Preemption model Scheduling algorithm Code structure Linear code structure Bertogna et al.['10, '11] Conditional code structure Our work ?
8
Control flowgraph: : set of basic blocks (BBs) : set of edges : WCET function of BBs : CRPD function of edges : Potential Preemption Point : Effective Preemption Point 8 Model Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions
9
9 Can handle "if else" and "switch" statements. Observation Model Series-parallel graphs: Graph Creation Series Composition Parallel Composition Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions
10
10 Problem Statement Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Series-parallel graphs Sum of BBs' WCET Sum of selected edges' CRPD Choose the path with max WCET+CRPD NPR from e 1 to Upper bound of NPR from schedulability analysis
11
11 Problem Statement Find a selection of EPPs that minimizes the WCET+CRPD of a flowgraph. The cost of any non-preemptive region should less than Q. A B CD E FGHI 34 12 12132 1 3551631 Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Cost=7 Cost=3 Cost = 24 Q=8 Bertogna et al.['11] Optimal selection of EPPs in sequential flowgraphs
12
12 Previous algorithm is not optimal for conditional structure. Use graph grammar and dynamic programming technique. Upper path: 28 Lower path: 25 Combined result: 32(U) Optimal result: 27(L) Observation Problem Statement How about the previous algorithm for conditional structure? A B C D E F JKL 34 1 2 12 132 1 3 5 516 31 G H I 1 23 16 7 5 Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions WCET+CRPD Q=8
13
13 Graph Grammar Decompose control flowgraphs (Linear time parsing) Extended Backus-Naur Form (EBNF) Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions
14
4/17/2015 14 Dynamic Programming: Sequential Block Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions 01234567 044444INF 14444 2444 344 44 5 6 7 01234567 07788 17888 28888 38888 48888 58888 6 7 Q=8 43 1 A B Blocks contains and :Blocks only contains : Cost matrices reflect optimal substructures
15
15 Corollary (1)For each path Four possible situations: whether take the preemption before and after the middle block; Choose the min WCET+CRPD from the four situations. (2)Choose the max WCET+CRPD among all paths. Theorem A optimal EPP selection of a CB is combined by optimal selections of all sequential paths. Theorem A optimal EPP selection of a larger block is combined by the optimal selections of left block and right block. Dynamic Programming: Conditional Block and Block Union Corollary (1)Preempt at the edge between the two blocks. Left block: cost[i][0]; Right block: cost[edge_value][j]; WCET+CRPD: cost[i][0]+ edge_value +cost[edge_value][j]. (2)Do not preempt at the edge between the two blocks. Leftblock: cost[i][x]; Rightblock: cost[Q-x][j]; x from 1to Q; WCET+CRPD: min{cost[i][x]+cost[Q-x][j]}. (3)Choose the smaller WCET+CRPD between (1) and (2) as cost[i][j] of the larger block. A B C D E F JKL 34 1 2 12 132 1 3 5 516 31 G H I 1 23 16 7 5 B 43 1 A Q=8 Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions (1) Get the optimal value of when preempt. (2) Get the optimal value of when do not preempt.
16
16 Dynamic Programming: Conditional Block and Block Union A B C D E F JKL 34 1 2 12 132 1 3 5 516 31 G H I 1 23 16 7 5 Q=8 Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions In conditional structure: Optimal EPPs selection in pseudo-polynomial time. Contribution
17
Approximate flexible matrix The WCET+CRPD will be larger than the optimal one. Reduce running time. Time complexity: 17 An Alternative Heuristic Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions... A B C D E F JKL 34 1 2 12 132 1 3 5 516 31 G H I 1 23 16 7 5 step each time
18
18 Computational Complexity Consider parse tree and cost matrix: Optimal solution: Heuristic solution: Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions
19
Randomly generate control flowgraphs: number of BBs. number of CBs. WCET of BBs: Gaussian distribution. CRPD: Correlates adjacent EPPs. Randomly generated with a gaussian factor. 19 Simulations Bertogna et al.['11] Similar to a realistic distribution Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions
20
20 Simulations: WCET Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions OPT (green mesh)<Alternative heuristic (black mesh)<SEQ (red mesh) WCET trend CRPD +
21
21 Simulations: Running time Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Alternative heuristic (black mesh) dominates over OPT and SEQ Time trend
22
22 Simulations: WCET Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Smaller size of matrices does not significantly increase WCET+CRPD Comparison of different setting for heuristics CRPD +
23
23 Simulations: Running time Background Background Model Model Problem Statement Problem Statement Solutions Solutions Conclusions Conclusions Smaller size of matrices significantly decreases running time Comparison of different setting for heuristics
24
24 Additional Structure Unrolled Loop Non-Unrolled Loop (a) Loops: Calculate the cost matrix of F i Embed F i to the main control flowgraph (b) Function call:
25
Conlusions: Extend the structure to conditional blocks Optimal algorithm for selection of EPPs An alternative heuristic to reduce running time Exhaustive simulation Future work: Planar separator theory Parameterized theory NP-Completeness Or, is the problem NP-Complete? Do optimal algorithms using polynomial time exist? 25 Conlusions and Future Work Background Background Model Model Problem Statement Problem Statement Solutions Solutions Future Work Future Work
26
26 Thanks!
27
27 Related Work EDF scheduled systems Fixed preemption point models Burns ['94] : [11] A. Burns. Preemptive priority based scheduling: An appropriate engineering approach EDF scheduled systems Floating preemption point models Baruah ['05] : [4] S. Baruah. The limited-preemption uniprocessor scheduling of sporadic task systems. Bertogna and S. Baruah ['10] : [5] M. Bertogna and S. Baruah. Limited preemption EDF scheduling of sporadic task systems. Fixed Priority scheduled system Fixed preemption point models Burns ['94] : [11] A. Burns. Preemptive priority based scheduling: An appropriate engineering approach Bril et al.['12]: [10]Worst-case response time analysis of real-time tasks under fixed-priority scheduling with deferred preemption. Bertogna et al. ['11]: [7] M. Bertogna et al. Improving feasibility of fixed priority tasks using non-preemptive regions. Davis et al. ['12] : [13] R. Davis and M. Bertogna. Optimal fixed priority scheduling with deferred preemption. Fixed Priority scheduled systemFloating preemption point models Yao et al. ['09]: [19] G. Yao, G. Buttazzo, and M. Bertogna. Bounding the maximum length of non-preemptive regions under fixed priority scheduling. linear code structure Fixed preemption point models Bertogna et al. ['10]: [6] M. Bertogna et al. Preemption points placement for sporadic task sets. Bertogna et al. ['11]: [8] M. Bertogna et al. Optimal selection of preemption points to minimize preemption overhead.
28
28 Additional Structure: Loops Whether preempt at e i, e j, e loop : eight possible situations Choose the smallest one as the value of the cost matrix (a) Non-Unrolled Loop: Preemption places inside the loop is not fixed Integrate this structure to conditional structure (b) Unrolled Loop:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.