Linux for Real Time applications in accelerator control systems Linux for control systems Andreas Steinbacher 16.11.09 1.

Slides:



Advertisements
Similar presentations
Vassal: Loadable Scheduler Support for Multi-Policy Scheduling George M. Candea, Oracle Corporation Michael B. Jones, Microsoft Research.
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
RT_FIFO, Device driver.
Process Management.
A Sample RTOS Presentation 4 Group A4: Sean Hudson, Manasi Kapadia Syeda Taib.
1 CS345 Operating Systems Φροντιστήριο Άσκησης 1.
Tutorial 3 - Linux Interrupt Handling -
Lecture 11: Operating System Services. What is an Operating System? An operating system is an event driven program which acts as an interface between.
Week 12 Real time kernel Ref: Extracts from:
INSE - Lectures 19 & 20 SE for Real-Time & SE for Concurrency  Really these are two topics – but rather tangled together.
QNX® real-time operating system
Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science.
I/O Multiplexing Road Map: 1. Motivation 2. Description of I/O multiplexing 3. Scenarios to use I/O multiplexing 4. I/O Models  Blocking I/O  Non-blocking.
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
CSE Fall Introduction - 1 What is an Embedded Systems  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)
CS Lecture 16 Outline Inter-process Communication (IPC) – Pipes – Signals Lecture 161CS Operating Systems 1.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
G Robert Grimm New York University Receiver Livelock.
Real-Time Operating Systems Suzanne Rivoire November 20, 2002
Performance Evaluation of Real-Time Operating Systems
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Real-time Systems Lab, Computer Science and Engineering, ASU Linux Input Systems (ESP – Fall 2014) Computer Science & Engineering Department Arizona State.
Introduction to Real-Time Systems
Today’s Agenda  Quick Review  Finish Java Threads  The CS Problem Advanced Topics in Software Engineering 1.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
UNIX Socket Programming CS 6378 Project Reference Book: Unix Network programming: Networking APIs: Sockets and XTI (2nd edition), Prentice Hall >> Threads.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Timers and Clocks II.
1 Signals (continued) CS 241 April 9, 2012 University of Illinois.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Multi-Tasking The Multi-Tasking service is offered by VxWorks with its real- time kernel “WIND”.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
O PERATING S YSTEM. What is an Operating System? An operating system is an event driven program which acts as an interface between a user of a computer,
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 More on Thread API.
Exception Handling in Java Topics: Introduction Errors and Error handling Exceptions Types of Exceptions Coding Exceptions Summary.
Real Time System with MVL. © 2007 MontaVista Confidential | Overview of MontaVista Agenda Why Linux Real Time? Linux Kernel Scheduler Linux RT technology.
MP2: RATE-MONOTONIC CPU SCHEDULING Based on slides by Gourav Khaneja, Raoul Rivas and Keun Yim University of Illinois at Urbana-Champaign Department of.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Introduction to Real-Time Operating Systems
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Module 12: I/O Systems I/O hardware Application I/O Interface
Linux Kernel Development - Robert Love
CS 6560: Operating Systems Design
Protection of System Resources
Real-time Software Design
CSCI 315 Operating Systems Design
Operating System Concepts
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Chapter 2: The Linux System Part 3
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Supporting Time-Sensitive Applications on a Commodity OS
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Linux for Real Time applications in accelerator control systems Linux for control systems Andreas Steinbacher

Agenda Why Linux? Standard CS architecture What is Real Time ? What RT do we need ? Real time Operating Systems What parameters do we need ? How do we test ? The kernel module The user program Results

Why Linux? Same OS for all control system tiers Linux is open, you know how things tick inside, and you can change them. Real Time capabilities look promising, experience,- but no data exist within CERN.

Standard CS architecture: Frontend Tier (4) Equipment Tier (3) ProcessingTier (2) Presentation Tier (1) Supervisory Control System Network Accelerator Control System Beam Control System Network

What is realtime? Soft Real Time: System performs not always within limits  consequences are not catastrophic. System is normally „fast enough“, errors can be detected in time. VOIP, Videoconferences, Hard Real Time: Crossing limits causes catastrophic consequences. System guaranties to be in time. Pacemaker, Automotive systems (ABS,ESP, Ignition) None Real Time: No limits or consequences. „postcard“

Soft Real-Time vs. Hard Real-Time: Latency Error Soft RT Hard RT

What RT do we need?

Real time operating systems VxWorks, LynxOS, RTEMS, QNX, also: DOS. And many more… RT_Preemptive „The RT-Preempt patch converts Linux into a fully preemptible kernel.“

What parameters do we need? Interrupt latency -> maxlat, dist… Periodic tasks -> maxlat, dist, jitter

How do we test? Defined Scheduler - FIFO/RR Defined Priority – 0,10,49,90,99 Defined Load – ltp´s loadgen

The kernel module Registers an interrupt handler: ret = request_irq(PARALLEL_PORT_INTERRUPT, &interrupt_handler,IRQF_DISABLED, "parallelport", NULL); Interrupt handler (triggered by stimulus pulse): static int interrupt_handler(void) { //send signal to user program kill_fasync(&inputdevice_async_queue, SIGIO, POLL_IN); return IRQ_HANDLED; } ioctl - I/O control (triggered by user program) static int skeleton_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { ….. outb_p(255, BASEPORT);outb_p(0, BASEPORT); //All high, all low

The user program Registers a Signal handler int InstallMySignalHandler(void) { sa.sa_handler = mySignalHandler; sigaction(SIGIO, &sa, &osa); //register handler return 0; } Signal Handler (triggered by kernel module) static void mySignalHandler () { ioctl(fd, CASE4, NULL);//tell driver to generate a pulse }

Results: Round trip time

SWAVE – Periodic tasks clock_nanosleep - high resolution sleep with specifiable clock (ADVANCED REALTIME) /* wait untill next shot */ clock_nanosleep(0, TIMER_ABSTIME, &t, NULL); If the flag TIMER_ABSTIME is set in the flags argument, the clock_nanosleep() function shall cause the current thread to be suspended from execution until either the time value of the clock specified by clock_id reaches the absolute time specified by the rqtp argument, or a signal is delivered to the calling thread and its action is to invoke a signal- catching function, or the process is terminated. If, at the time of the call, the time value specified by rqtp is less than or equal to the time value of the specified clock, then clock_nanosleep() shall return immediately and the calling process shall not be suspended.

Results: Periodic tasks RT

Results: Periodic tasks NON RT

Results: Periodic tasks

Conclusion From the collected data it can be said that RT_Preemptive is not suitable for a hard Real Time system. Even though outliners appear only <=1 time in a million, they disqualify RT_Preemptive from being hard RT. Also it can be claimed that RT_Preemptive offers exceptional performance for periodic tasks and IO-driven applications thus qualifying it to be suitable for soft RT with reserves for error avoidance or correction. Development side of view: It´s flexible! Hard RT should be delegated to hardware.

Outlook: Paper on RT_Preemptive performance Test net socket RT performance Create an application to reconstruct the exact MA use – case.

End of Presentation: The time is gone The song is over Thought I'd something more to say…