Overview of Linux real-time challenges

4,655 views

Published on

My talk at foss-sthlm embedded Linux hacking day, June 1st 2013.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,655
On SlideShare
0
From Embeds
0
Number of Embeds
3,112
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Overview of Linux real-time challenges

  1. 1. Overview of Linux real­time challengesJune 1, 2013
  2. 2. Daniel StenbergEmail: daniel@haxx.seTwitter: @bagderWeb: daniel.haxx.seBlog: daniel.haxx.se/blog●Free Software●Network hacker●Embedded developer●Consultant
  3. 3. AgendaWhats real-time in this context?Why is real-time still a concern?Ways to deal with the problem• Off to secondary hardware• Hypervisor or AMP• PREEMPT_RT• CPU isolation and dynamic tickFuture?
  4. 4. Real­timeReal-time can mean a lot of differentthings to different audiences• Low maximum latency: below 100 us,sometimes down to 20us• Very low risk of every breaking that
  5. 5. Why is this a concern 2013?• Plain Linux wasnt designed to deal with low latency• A move towards "commodity" hardware - lessspecial stuff means solving the problems in generalCPUs• Linux everywhere: RTOS-solutions get moved overfrom legacy systems to Linux-based• Still a lot of stacks and applications that act in CPUbut needs to respond fast and accurately• Sometimes a bit more requested than perhaps canbe technically motivated
  6. 6. What are the options?Linux is a given.What magic can you apply to a systemto address the problem of a lowmaximum latency?
  7. 7. Separate dedicated HW• A tested and proven way• A separate small chip (with anRTOS?) for just the time critical stuff• ... or an FPGA• But it adds system complexity andprice
  8. 8. Hypervisor with RTOS• Isnt pure Linux• Adds complexity• Usually proprietary• May reach really low latenciesOne or more cores
  9. 9. AMP with RTOS• Isnt pure Linux• Adds complexity• Often proprietary• May reach really low latenciesCore 0 Core 1 Core 2 Core 3
  10. 10. The more pure Linux solutions1 ­ Address and lower the worst case2 ­ Avoid hitting the worst case
  11. 11. PREEMPT_RT●An off­mainline patch since 10+ years!●Add preemption to lower max latency●replace kernel spinlocks with mutexes●move interrupts and software interrupts to kernel threads●works on single core systems●Changes behavior and requires drivers to be tested●User­space is the same
  12. 12. CPU isolation 1/2●NOHZ, dynamic tick●Isolated cores == without ticks do nothing!●Only one thread allowed!●Avoiding the kernel is hard●Approaching mainline (3.10)●Requires rethinking user­space
  13. 13. Linux kernelCore 0 Core 1 Core 2 Core 3CPU isolation 2/2
  14. 14. Future●Real­time and latency remain interesting●PREEMPT_RT is not in mainline●NOHZ is just getting in●We create the future!
  15. 15. (from UBM Tech Electronics Embedded Market Survery)
  16. 16. Work with this at Enea
  17. 17. Thank youDaniel Stenberg <daniel@haxx.se>

×