Analysis of interrupt latencies in a real-time kernel

4,691 views

Published on

BSc CS graduation project (March 2008)

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,691
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
65
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Analysis of interrupt latencies in a real-time kernel

  1. 1. Analysis of interrupt latencies in a real-time Università degli Studi di Trento kernel Facoltà di Scienze Matematiche Fisiche e Naturali Real-time operating systems Real-time Linux CFS Analysis of interrupt latencies in a Recap real-time kernel March 26, 2008Laureando: Gabriele Modena (Mat. 108742)Relatore: dott. Luigi PalopoliCorrelatore: dott. Luca Abeni
  2. 2. Analysis ofReal-Time Operating Systems (RTOS) interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS RecapEnsure that an operation completes within a fixed amountof time (deadline) =⇒ predictability.When dealing with device drivers this implies managing race conditions; fulfill temporal constraints.This thesis focuses on shared mixed resources.
  3. 3. Analysis ofLatency interrupt latencies in a real-time kernel Real-timeLatency is the measure of the difference between the operating systemstheoretical (algorithm) and actual (implementation) Real-time Linuxschedule. CFS RecapIn a RTOS latency: should be bounded; the bound should not be too high.The goal of a real-time kernel is to minimize latency byusing algorithms and technology that properlyimplements them: preemptible kernel.
  4. 4. Analysis ofLinux as an RTOS interrupt latencies in a real-time kernel Real-time operating systemsLinux vanilla: Real-time Linux since 2.6 preemptible kernel; CFSThe rt-preempt patch: Recap developed by Ingo Molnar; makes Linux hard real-time; uses the new (2.6.21) high resolution timers; preemptible critical sections; real-time mutexes; threaded interrput handlers.
  5. 5. Analysis ofBenchmarking rt-preempt interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS RecapTwo goals: test the actual real-time performance; test the performance of I/O scheduling.We look for a trade-off between latency and throughput.
  6. 6. Analysis ofCyclictest interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS high resolution test program written by Thomas Recap Gleixner; measure latency; schedules periodic threads;When it comes to real-time applications rt-preempt givesthe expected performance.
  7. 7. Analysis ofVanilla vs. rt-preempt (1) interrupt latencies in a real-time kernel Probability of the latency (num. of samples / total samples) Real-time Preemptible Linux operating systems 1 Real-time Linux CFS 0.1 Recap 0.01 0.001 0.0001 1e-05 1e-06 0 1000 2000 3000 4000 5000 6000 Latency (usecs)
  8. 8. Analysis ofVanilla vs. rt-preempt (2) interrupt latencies in a real-time kernel Probability of the latency (num. of samples / total samples) Real-time RT Linux operating systems 1 Real-time Linux CFS 0.1 Recap 0.01 0.001 0.0001 1e-05 1e-06 0 10 20 30 40 50 60 Latency (usecs)
  9. 9. Analysis ofI/O scheduling interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS In traditional operating systems interrupt handler Recap have priority above everything. rt-preempt =⇒ soft and hard irq handlers are threads: scheduling I/O ≡ scheduling tasks.
  10. 10. Analysis ofBenchmark network throughput interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS netperf; Recap UDP traffic; 750B datagrams; schedule the real-time network threads; 30 minutes execution.
  11. 11. Analysis ofFixed priority scheduling interrupt latencies in a real-time kernelIt is not possibile to obtain low latency and highthroughput; Real-time operating systems Real-time Linux Net priority min. lat (µs) max. lat (µs) Tp (Mbps) CFS 1 20 94 38.9 Recap 50 22 96 39.9 80 20 148 77.4 99 22 164 73.4 Table: Linux 2.6.24-rc2-rt1, 750B UDP datagrams high throughput and high latency; low throughput and low latency.Fixed priority scheduling is not suitable =⇒ we look fora method to assign CPU quota to tasks.
  12. 12. Analysis ofCompletely Fair Scheduler interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS Recap implemented by Ingo Molnar; merged in mainline since 2.6.23; weights tasks by ratio; group scheduling;
  13. 13. Analysis ofcfs & rt-preempt interrupt latencies in a real-time kernelMy work Real-time use CFS and modify the nice system call to set operating systems weights (> 200 µs); Real-time Linux CFS use CFS and tune Control Groups (> 1000 µs). RecapResults net cyc load lat (µs) Tp (Mbps) 1 1 1 2931 49.9 2 1 1 3911 67.3 2 2 1 3721 71.1 4 2 1 6117 80.9 1 1 4 2871 35.2 Table: Scheduling real-time threads with CFS
  14. 14. Analysis ofcfs & rt-preempt interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS impact on the I/O throughput =⇒ the ratio system Recap works; high latencies.Short time possible solutions CFS clean up and tuning (in progress); EDF scheduling + time limit (Linux 2.6.25).
  15. 15. Analysis ofOverview of the work interrupt latencies in a real-timeStep 1 kernel litterature study on real-time computing; Real-time study of the rt-preempt patch and real-time under Linux; operating systems Real-time LinuxStep 2 CFS Recap benchmark real-time performance; study the relationship between I/O and real-time applications;Step 3 test the CFS scheduler; try custom and standard solutions;Future work results presented at the RTAS 2008 conference (http://www.rtas.org/ ); tuning CFS and testing new scheduling policies.
  16. 16. Analysis ofQuestions interrupt latencies in a real-time kernel Real-time operating systems Real-time Linux CFS Recap Any question?

×