thomas gleixner – linutronix linux in automation 2004 – uni hannover
TRANSCRIPT
![Page 1: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/1.jpg)
Thomas Gleixner – linutronixLinux in Automation 2004 – Uni Hannover
![Page 2: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/2.jpg)
Was ist das ?
LInux Based Enhanced RealTime Operating System
Modifikation des Linux-Kernels zur Erlangung der Echtzeitfähigkeit
basierend auf dem KURT Projekt (Kansas University Realtime) unter der Leitung von Prof. Douglas Niehaus
![Page 3: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/3.jpg)
Warum ?
● Performance
● Speicherbedarf
● Portierbarkeit
● Dual Kernel ist für viele User schwierig zu
handhaben
![Page 4: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/4.jpg)
Designvorgaben
● Quality of Service
● Instrumentierbarkeit
● Unterstützung für vernetzte Systeme
● Modularität
● Portierbarkeit
![Page 5: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/5.jpg)
Quality of Service
“As fast as specified
rather than
as fast as possible”Zitat Douglas Niehaus
![Page 6: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/6.jpg)
Funktionalität
● Microsekunden Timer
● Instrumentierung für Kernel / Userspace
● Modularer Echtzeitscheduler
● Interrupthandling unter Schedulerkontrolle
● Userspace Realtime
![Page 7: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/7.jpg)
µsec Timer
● Driftkompensation
● Synchronisation von vernetzen Systemen
● Schlanke Implementation auf reiner 32 bit
Arithmetik
● Busyloops für kurze Delays entfallen
![Page 8: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/8.jpg)
µsec Timer
Voraussetzungen● Frei laufender Timer oder Time Stamp
Counter. Emulation des x86 TSC für 16 und
32 bit Timer
● One-shot programmierbarer Timer
![Page 9: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/9.jpg)
Instrumentierung
● DSKI (Data Stream Kernel Interface)
● DSUI (Data Stream Userspace Interface)
● Alle relevanten Codeteile sind instrumentiert
● Eventaufzeichnung selektierbar
● Netzwerksupport für Embedded Systeme
![Page 10: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/10.jpg)
Instrumentierung
● Eventspeicher wird in XML umgewandelt
● Python basierte Auswertung
![Page 11: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/11.jpg)
RT - Scheduler
● Erweiterung der Linux Task Struktur. Dadurch Userspace Realtime zum Nulltarif
● RT-Scheduler entscheidet vor dem eigentlichen Linux-Scheduler
● Groupscheduling
● Modular ladbare Scheduling Algorithmen
● Watchdog Funktion
![Page 12: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/12.jpg)
RT - Scheduler
Schedule()
RT-Scheduler
SchedulerModul
SchedulerModul
SchedulerModul
RT ?
Taskswitch
Linux scheduler
Ja
Nein
![Page 13: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/13.jpg)
Groupscheduling
● Bilden von Prozessgruppen
● Scheduling der Prozessgruppen
● Scheduling der Prozesse in den Gruppen
![Page 14: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/14.jpg)
Groupscheduling
Beispiel
Timeslice
P4, P5P6, P7P1, P2, P3
Group 1 Group 2 Group 3
P8, P9
EDF Priority RR
![Page 15: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/15.jpg)
Groupscheduling
Implementierte Algorithmen
● Priority
● Priority mit Quantum
● Early Deadline First
● Round Robin
● Explicit Plan
● Periodic
![Page 16: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/16.jpg)
Groupscheduling
System Decision Function (SDF)
● Scheduling von Systemereignissen
● Scheduling von Interrupthandlern
● Scheduling von Tasklets
![Page 17: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/17.jpg)
Interrupthandling
● CLI/STI durch Softwareflag ersetzt
● Interrupts sind auf Hardwareebene fast
immer enabled
● Support für Per IRQ locking
● Softwarepriorisierung von Interrupts
● Interrupts unter Schedulerkontrolle (SDF)
![Page 18: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/18.jpg)
Interrupthandling
IRQ Entry
RT
IRQ ?
CLI ?RT
cont
ext ?
Notification
N N N
J J
IRQ handler
IRQ Exit
Lock
ed ? J
Can ru
n ?
(SDF)
N
N
J
J
![Page 19: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/19.jpg)
Interrupthandling
IRQ1, IRQ5IRQ11
RT IRQ Group
Priority
IRQ1, IRQ5IRQ11
Linux IRQ Group
EDF
Bottom Halfs,Tasklets
Linux SDF Group
Sequential
Interrupthandling im Scheduler (SDF)
![Page 20: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/20.jpg)
Userspace Realtime
● Standard Userspace Programmierung● Posix-Threads● Realtime Verhalten kann innerhalb des Programms oder von aussen beinflusst werden
● Debugging von Realtime Anwendungen mit GDB
● Userspace Devicedriver Support
![Page 21: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/21.jpg)
Userspace Realtime
Standard IPC Mechanismen
● Signale● Semaphoren● Fifos● Pipes● Shared Memory
![Page 22: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/22.jpg)
Userspace Realtime
Restriktionen
● Blockierende Systemcalls (Disk-I/O)
![Page 23: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/23.jpg)
Performance
P3 1,4Ghz, 100% load
![Page 24: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/24.jpg)
Performance
P3 1,4Ghz, 100% load
![Page 25: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/25.jpg)
Performance
P3 1,4Ghz, 100% load
![Page 26: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/26.jpg)
Performance
P3 1,4Ghz, 100% load
![Page 27: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/27.jpg)
Performance
Load 2.4.22 RTS IRQH
0% 180µs 44µs 24µs
12ms 58µs 24µs
74ms 276µs 44µs
100%(1)
100% +IRQ(2)
Maximum Signal propagation delay
Celeron 333MHz (1) 100% Userspace load(2) 50% Userspace 50% System load (ping -f, serial communication 115200 Bd)
![Page 28: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/28.jpg)
Portierbarkeit
Es müssen nur der Timer und die Interrupt Entry Funktion portiert werden
● ARM7 ca. 120 Zeilen Code + 100 Zeilen Makros
● PPC405 ca. 200 Zeilen Code + 100 Zeilen Makros
![Page 29: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/29.jpg)
Status
Funktion X86 ARM PPC
µsec Timer X
DSKI / DSUI X X X
Scheduler X X X
Interrupt Handling X WIP WIP
System Decision F. WIP WIP WIP
X (1) X (1)
(1) Nicht alle Derivate implementiertWIP = Work In Progress
![Page 30: Thomas Gleixner – linutronix Linux in Automation 2004 – Uni Hannover](https://reader035.vdocuments.net/reader035/viewer/2022062623/55204d8049795902118d2a90/html5/thumbnails/30.jpg)
Verwendung
Verwendung● Telekommunikation (ATM-Switching)● ACE/TAO wird von Chris Gill auf LibeRTOS betrieben.
Hierbei ist vor allem die Integration der ACE Scheduling Funktionalität in die Groupscheduling Funktion von LibeRTOS ein vorrangiges Ziel.
● Video/Audio Streaming, HD-Recording● Messtechnik, Datenerfassung / aufbereitung