TimerShield Im Implementation Further details in the paper! Open-source implementation at https://people.mpi-sws.org/~bbb/papers/details/rtas17p/ 57
Talk Overv rview Timers and the Interference Problem TimerShield Design Evaluation 58
Evaluation Prototyped in PREEMPT_RT Intel Core-i5 ARM Cortex-A53 4 x 3.2Ghz 4 x 1.2Ghz 59
Evaluation Prototyped in PREEMPT_RT Details in paper Intel Core-i5 ARM Cortex-A53 4 x 3.2Ghz 4 x 1.2Ghz 60
Evaluation How effective is TimerShield at isolating high-priority tasks from low-priority timer interrupts? How is the context-switch duration affected? How costly are the new queueing data structures? 61
Evaluation How effective is TimerShield at isolating high-priority tasks from low-priority timer interrupts? How is the context-switch duration affected? How costly are the new queueing data structures? 62
HP Task Response Time We measured the response time of a high-priority task with varying number of low-priority, timer-using tasks 63
HP Task Response Time 1 KHz control loop with approx. 200 μ s computation time We measured the response time of a high-priority task with varying number of low-priority, timer-using tasks Taskset parameters based on S. Kramer, D. Ziegenbein, and A. Hamann, 64 “Real world automotive benchmark for free,” in WATERS, 2015.
HP Task Response Time 1 KHz control loop with approx. 200 μ s computation time We measured the response time of a high-priority task with varying number of low-priority, timer-using tasks cyclictest tasks which periodically call clock_nanosleep() Taskset parameters based on S. Kramer, D. Ziegenbein, and A. Hamann, 65 “Real world automotive benchmark for free,” in WATERS, 2015.
HP Task Response Time 1 KHz control loop with approx. 200 μ s computation time We measured the response time of a high-priority task with varying number of low-priority, timer-using tasks cyclictest tasks From 1 to 100 LP which periodically call cyclictest tasks clock_nanosleep() Taskset parameters based on S. Kramer, D. Ziegenbein, and A. Hamann, 66 “Real world automotive benchmark for free,” in WATERS, 2015.
HP Task Response Time 67
HP Task Response Time Means 60% of the measured samples have a response time ≤ 214.8us 68
Response Tim ime - hrtimers 1 LP cyclictest 69
Response Tim ime - hrtimers 100 LP cyclictests 50 LP cyclictests 1 LP cyclictest 70
Response Tim ime - hrtimers Long tail, high unpredictability 100 LP cyclictests 50 LP cyclictests 1 LP cyclictest 71
Response Tim ime - Tim imerShield 72
Response Tim ime - Tim imerShield Response time with 1, 50 or 100 LP timers remains consistent! 73
Response Tim ime - Tim imerShield Slight shift due to cache effects of increasing number of low-priority tasks Response time with 1, 50 or 100 LP timers remains consistent! 74
How Bad Can It It Get? Linux (and POSIX) provide no protection , and specifies no upper limit on timer creation 75
How Bad Can It It Get? Linux (and POSIX) provide no protection , and specifies no upper limit on timer creation We measured the response time of a high-priority task with a single, unprivileged, user-space task that spawned timers 76
How Bad Can It It Get? Linux (and POSIX) provide no protection , and specifies no upper limit on timer creation We measured the response time of a high-priority task with a single, unprivileged, user-space task that spawned timers Using Linux’s timerfd API 77
Response Tim ime - hrtimers Idle system 100 LP timers 1000 LP timers 78
Response Tim ime - hrtimers Nearly 45us (22%) response- time increase with 1000 low-priority timers 79
Response Tim ime - Tim imerShield 1000 LP timers 100 LP timers Idle System 80
Response Tim ime - Tim imerShield 1000 LP timers 100 LP timers TimerShield protects high-priority task response times from low-priority timer interrupts! Idle System 81
Evaluation How effective is TimerShield at isolating high-priority tasks from low-priority timer interrupts? How is the context-switch duration affected? How costly are the new queueing data structures? 82
Additional Context xt-Switch Delay During context-switches, TimerShield processes expired timers, performs a RMQ, and optionally reprograms hardware Note: Results for a scenario without a timer-heavy load can be found in the paper. 83
Additional Context xt-Switch Delay During context-switches, TimerShield processes expired timers, performs a RMQ, and optionally reprograms hardware We measured the total additional time incurred by TimerShield during context-switches in a timer-heavy scenario Note: Results for a scenario without a timer-heavy load can be found in the paper. 84
Additional Context xt-Switch Delay During context-switches, TimerShield processes expired timers, performs a RMQ, and optionally reprograms hardware We measured the total additional time incurred by TimerShield during context-switches in a timer-heavy scenario 1 high-priority and 50 low-priority timer-using tasks of the same priority Note: Results for a scenario without a timer-heavy load can be found in the paper. 85
Additional Context xt-Switch Delay 9 8 7 microseconds (us) 6 5 4 3 2 1 0 Mean Median 99.9th percentile Max 86
Additional Context xt-Switch Delay 9 8 Mean and median delay 7 microseconds (us) (typical case) is much 6 less than a microsecond 5 4 3 2 1 0 Mean Median 99.9th percentile Max 87
Additional Context xt-Switch Delay 9 8 These reflect batch 7 microseconds (us) processing of multiple 6 timers that were deferred 5 4 3 2 1 0 Mean Median 99.9th percentile Max 88
Timer Processing Delay 16 14 microseconds (us) 12 We measured the worst- 10 case increase in HP task 8 response time under 6 hrtimers with the same 4 experimental setup 2 0 Timer Processing Delay Hrtimers TimerShield 89
Batch Processing is is Better! 16 hrtimers takes longer 14 due to the repetitive microseconds (us) 12 switches to interrupt context! 10 8 6 4 2 0 Timer Processing Delay Hrtimers TimerShield 90
Batch Processing is is Better! 16 14 microseconds (us) 12 10 Context-switch delay due to TimerShield is small, and its 8 6 batch processing of timers is faster than hrtimers 4 2 0 Timer Processing Delay Hrtimers TimerShield 91
Evaluation How effective is TimerShield at isolating high-priority tasks from low-priority timer interrupts? How is the context-switch duration affected? How costly are the new queueing data structures? 92
Data-Structure Overheads The worst case for TimerShield’s data-structures is with a single timer , because each operation modifies the segment tree Note: Results for a scenario with a timer-heavy load can be found in the paper. 93
Data-Structure Overheads The worst case for TimerShield’s data-structures is with a single timer , because each operation modifies the segment tree We measured the timer enqueue and dequeue cost on both subsystems for this setup Note: Results for a scenario with a timer-heavy load can be found in the paper. 94
Timer Enqueue Cost 0.4 0.35 microseconds (us) 0.3 0.25 0.2 0.15 0.1 0.05 0 Mean Median 99.9th percentile Max Hrtimers TimerShield Lower is Better 95
Timer Enqueue Cost 0.4 0.35 Performs negligibly worse on microseconds (us) 0.3 average 0.25 Favourable towards the max, 0.2 but the difference is miniscule 0.15 0.1 0.05 0 Mean Median 99.9th percentile Max Hrtimers TimerShield Lower is Better 96
Timer Dequeue Cost 0.4 0.35 Both subsystems have very microseconds (us) 0.3 similar dequeue costs 0.25 0.2 0.15 0.1 0.05 0 Mean Median 99.9th percentile Max Hrtimers TimerShield Lower is Better 97
Evaluation Summary ry Impossible for high-priority tasks to be interrupted by low-priority timers under TimerShield Note: Further experiments, including results for ARM, can be found in the paper. 98
Evaluation Summary ry Impossible for high-priority tasks to be interrupted by low-priority timers under TimerShield Additional context-switch delay is small , and batch timer processing is faster with TimerShield Note: Further experiments, including results for ARM, can be found in the paper. 99
Evaluation Summary ry Impossible for high-priority tasks to be interrupted by low-priority timers under TimerShield Additional context-switch delay is small , and batch timer processing is faster with TimerShield TimerShield’s data structure costs are comparable to hrtimers Note: Further experiments, including results for ARM, can be found in the paper. 100
Recommend
More recommend