Boosting Job-Level Migration by Static Analysis Workshop on Operating Systems Platforms for Embedded Real-Time Applications July 09, 2019 Tobias Klaus, Peter Ulbrich, Phillip Raffeck, Benjamin Frank, Lisa Wernet , Maxim Ritter von Onciul , Wolfgang Schröder-Preikschat Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) SCHR 603/9-2 EU EFRE funds SCHR 603/13-1 SCHR 603/14-2 0704/883 25 CRC/TRR 89 Project C1
T Core 2: Core 1: T Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores τ 1 τ 3 t 0 20 40 60 80 100 τ 2 t 0 20 40 60 80 100 Boosting job-level migration by static analysis 1
Core 1: Core 2: T T Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores → Poor utilization and schedulability τ 1 τ 3 t 0 20 40 60 80 100 τ 2 t 0 20 40 60 80 100 Boosting job-level migration by static analysis 1
Core 2: Core 1: T T Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores → Poor utilization and schedulability τ 1 τ 3 Solution: Full Migration t 0 20 40 60 80 100 • Dynamic (re)allocation of tasks • Good utilization and schedulability τ 2 t 0 20 40 60 80 100 Boosting job-level migration by static analysis 1
Core 2: Core 1: T T Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores → Poor utilization and schedulability τ 3 a τ 1 Solution: Full Migration? t 0 20 40 60 80 100 • Dynamic (re)allocation of tasks • Good utilization and schedulability τ 2 τ 3 b t 0 20 40 60 80 100 Boosting job-level migration by static analysis 1
T Core 1: T Core 2: Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores → Poor utilization and schedulability τ 3 a τ 1 Solution: Full Migration? t 0 20 40 60 80 100 • Dynamic (re)allocation of tasks • Good utilization and schedulability τ 2 τ 3 b t → Impractical in real-time systems 0 20 40 60 80 100 Boosting job-level migration by static analysis 1
Core 2: Core 1: T T Multi-Core Scheduling Multi-Core Systems • Static allocation of tasks to cores → Poor utilization and schedulability τ 3 a τ 1 Solution: Full Migration? t 0 20 40 60 80 100 • Dynamic (re)allocation of tasks • Good utilization and schedulability τ 2 τ 3 b t → Impractical in real-time systems 0 20 40 60 80 100 Static Allocation Again? • Split tasks to appropriate size Boosting job-level migration by static analysis 1
uint8_t j return ; 10 j j += baz[ ]; z j } z = 0; < 5; ++) { 1 2 3 4 5 6 7 for ( 9 i = 0; int32_t x uint16_t y = foo(); ( = 0; < 5; ++) { for uint8_t i i x += * bar[ ]; x y i } = * 4711; int64_t z 8 Splitting the Execution Size versus Costs Find Appropriate Split Points Boosting job-level migration by static analysis 2
j z Lifespan: j += baz[ ]; z j } return ; 1 for 2 3 4 5 6 7 8 9 uint8_t j = 0; < 5; ++) { x y i z j i = 0; int32_t x uint16_t y = foo(); ( = 0; < 5; ++) { for uint8_t i i ( += * bar[ ]; x y i } = * 4711; int64_t z x 10 Splitting the Execution Size versus Costs Find Appropriate Split Points • Static analysis Boosting job-level migration by static analysis 2
j z j Lifespan: += baz[ ]; z j } return ; 1 for 2 3 4 5 6 7 8 9 uint8_t j = 0; < 5; ++) { x y i z j i = 0; int32_t x uint16_t y = foo(); ( = 0; < 5; ++) { for uint8_t i i ( += * bar[ ]; x y i } = * 4711; int64_t z x 10 Splitting the Execution Size versus Costs Find Appropriate Split Points • Static analysis • Consider WCET Boosting job-level migration by static analysis 2
j z j Lifespan: += baz[ ]; z j } return ; 1 for 2 3 4 5 6 7 8 9 uint8_t j = 0; < 5; ++) { x y i z j i = 0; int32_t x uint16_t y = foo(); ( = 0; < 5; ++) { for uint8_t i i ( += * bar[ ]; x y i } = * 4711; int64_t z x 10 Splitting the Execution Size versus Costs Find Appropriate Split Points • Static analysis • Consider WCET • Minimize migration cost Boosting job-level migration by static analysis 2
Migration Challenges • Split tasks to target WCET Boosting job-level migration by static analysis 3
Migration Challenges • Split tasks to target WCET • Reduce migration cost Boosting job-level migration by static analysis 3
Migration Challenges • Split tasks to target WCET • Reduce migration cost Approach → Job-Level Migration → Static Analysis → Optimization within two dimensions Boosting job-level migration by static analysis 3
Overview Randomly sized Static analysis Split point graph scheduling units Sequential Optimization Uniformly sized within WCET and Branches scheduling units migration cost Loops Boosting job-level migration by static analysis 4
Overview Randomly sized Static analysis Split point graph scheduling units Sequential Optimization Uniformly sized within WCET and Branches scheduling units migration cost Loops Boosting job-level migration by static analysis 5
Static analysis E 1 BB 1 BB 3 BB 4 Basic Procedure 1 1. Create control-flow graph BB 5 2. WCET analysis 3. Lifespan analysis BB 6 BB 7 Boosting job-level migration by static analysis 6
Static analysis E 1 BB 1 BB 3 BB 4 Basic Procedure 1 1. Create control-flow graph BB 5 2. WCET analysis Split-point candidates 3. Lifespan analysis BB 6 BB 7 Boosting job-level migration by static analysis 6
Split-Point Graphs Randomly sized Static analysis Split-point graph scheduling units Sequential Optimization Uniformly sized within WCET and Branches scheduling units migration cost Loops Boosting job-level migration by static analysis 7
General Concept: Split-Point Graphs Control-Flow Graph E 1 BB 1 w 1 w 2 BB 3 BB 4 w 3 w 4 BB 5 BB 6 BB 7 Boosting job-level migration by static analysis 8
General Concept: Split-Point Graphs Control-Flow Graph Intermediate Graph E 1 E 1 BB 1 w 1 w 2 BB 3 BB 4 w 3 w 4 BB 5 BB 6 BB 7 Boosting job-level migration by static analysis 8
General Concept: Split-Point Graphs Control-Flow Graph Intermediate Graph Split-Point Graph E 1 E 1 BB 1 w 2 w 1 w 2 BB 3 BB 4 w 3 w 4 w 1 w 3 BB 5 w 4 BB 6 w 5 BB 7 Boosting job-level migration by static analysis 8
General Concept: Split-Point Graphs Control-Flow Graph Intermediate Graph Split-Point Graph E 1 E 1 BB 1 Boosting Job-Level Migration w 2 w 1 w 2 BB 3 BB 4 • Static analysis of tasks w.r.t. WCET and resident-set size w 3 w 4 w 1 w 3 • Split-point graphs capture split-point candidates BB 5 • Horizontal cuts: finding split points with low migration cost w 4 BB 6 w 5 BB 7 Boosting job-level migration by static analysis 8
Overview Randomly sized Static analysis Split point graph scheduling units Sequential Optimization Uniformly sized within WCET and Branches scheduling units migration cost Loops Boosting job-level migration by static analysis 9
Splitting Loops Let the body untouched! Original Loop 1 LOOP_Bound(x:10); 2 for ( int i = 0; i < x; ++i) 3 { .... } • Splitting the loop body? • # of iterations dominates WCET Boosting job-level migration by static analysis 10
Splitting Loops Let the body untouched! Original Loop 1 LOOP_Bound(x:10); 2 for ( int i = 0; i < x; ++i) 3 { .... } • Splitting the loop body? • # of iterations dominates WCET → Split by number of iterations! Boosting job-level migration by static analysis 10
Splitting Loops Let the body untouched! Original Loop Loop after Splitting 1 LOOP_Bound(x:10); 1 int i = 0, C = 5; 2 for ( int i = 0; i < x; ++i) 2 for (; i < x && C; ++i) 3 { .... } 3 { --C; .... } .... 4 C = 5; 5 • Splitting the loop body? 6 for (; i < x && C; ++i) • # of iterations dominates WCET 7 { --C; .... } → Split by number of iterations! General Approach • Compute number of iterations to fit target WCET • Derive upper bound for the number of cuts • Duplicate body and adjust loop condition Boosting job-level migration by static analysis 10
150 SPLIT 200 350 SU B C = 200 FALSE C false = 10 TRUE C = 150 TRUE C SU A true FALSE = 160 Scheduling Unit (SU) true false exit 205 C TRUE false cond C = 205 FALSE cond exit true = 5 Splitting Branches The problem with conditional load ... Additional Pessimism Caused by Naive Splitting • Local optimization may lead to unbalanced cuts in branches • Condition is unknown at compile time → Overapproximation in timing analysis Boosting job-level migration by static analysis 11
�� �� �� � �� � ����� ��������� ������������ ����������� ������������ �� � �� � �� � �� � �� � �� � �� �� �� � �� �� �� �� Splitting Branches Global vs. Local Optimization • Find suitable points locally • Global alignment between branches → Minimize size differences Boosting job-level migration by static analysis 12
Recommend
More recommend