timershield
play

TimerShield Protecting High-Priority Tasks from Low-Priority Timer - PowerPoint PPT Presentation

TimerShield Protecting High-Priority Tasks from Low-Priority Timer Interference Pratyush Patel 1,2 , Manohar Vanga 1 , Bjrn Brandenburg 1 1 MPI-SWS, 2 Carnegie Mellon University RTAS 2017 April 18, 2017 Pittsburgh, USA Kaiserslautern,


  1. TimerShield Im Implementation Further details in the paper! Open-source implementation at https://people.mpi-sws.org/~bbb/papers/details/rtas17p/ 57

  2. Talk Overv rview Timers and the Interference Problem TimerShield Design Evaluation 58

  3. Evaluation Prototyped in PREEMPT_RT Intel Core-i5 ARM Cortex-A53 4 x 3.2Ghz 4 x 1.2Ghz 59

  4. Evaluation Prototyped in PREEMPT_RT Details in paper Intel Core-i5 ARM Cortex-A53 4 x 3.2Ghz 4 x 1.2Ghz 60

  5. 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

  6. 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

  7. HP Task Response Time We measured the response time of a high-priority task with varying number of low-priority, timer-using tasks 63

  8. 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.

  9. 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.

  10. 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.

  11. HP Task Response Time 67

  12. HP Task Response Time Means 60% of the measured samples have a response time ≤ 214.8us 68

  13. Response Tim ime - hrtimers 1 LP cyclictest 69

  14. Response Tim ime - hrtimers 100 LP cyclictests 50 LP cyclictests 1 LP cyclictest 70

  15. Response Tim ime - hrtimers Long tail, high unpredictability 100 LP cyclictests 50 LP cyclictests 1 LP cyclictest 71

  16. Response Tim ime - Tim imerShield 72

  17. Response Tim ime - Tim imerShield Response time with 1, 50 or 100 LP timers remains consistent! 73

  18. 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

  19. How Bad Can It It Get? Linux (and POSIX) provide no protection , and specifies no upper limit on timer creation 75

  20. 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

  21. 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

  22. Response Tim ime - hrtimers Idle system 100 LP timers 1000 LP timers 78

  23. Response Tim ime - hrtimers Nearly 45us (22%) response- time increase with 1000 low-priority timers 79

  24. Response Tim ime - Tim imerShield 1000 LP timers 100 LP timers Idle System 80

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

  30. Additional Context xt-Switch Delay 9 8 7 microseconds (us) 6 5 4 3 2 1 0 Mean Median 99.9th percentile Max 86

  31. 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

  32. 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

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

  39. 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

  40. 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

  41. 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

  42. 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

  43. 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

  44. 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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend