Supporting Time Sensitive Application in a Commodity OS Ashvin Goel, Luca, Charles, Jim, Jonathan Walpole Oregon Graduate Institute, Portland Presented.

Slides:



Advertisements
Similar presentations
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
Advertisements

1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
The Performance of Spin Lock Alternatives for Shared-Memory Microprocessors Thomas E. Anderson Presented by David Woodard.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Project 2 – solution code
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
1 Predictable Scheduling for a Soft Modem Michael B. Jones – Microsoft Research Stefan Saroiu – University of Washington.
Supporting Time-sensitive Application on a Commodity OS Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presented by Wen Sun Some Slides.
Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
Chapter 13 Embedded Systems
Supporting Time-sensitive Application on a Commodity OS By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Shuping Tien.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
CS533 Concepts of Operating Systems Class 10 Fine Grain Timing.
Computer Organization and Architecture
CS533 Concepts of Operating Systems Class 18 Fine Grain Timing.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
Soft Timers Efficient Microsecond Software Timer Support for Network Processing MOHIT ARON and PETER DRUSCHEL Rice University Published in ACM Transactions.
Comparative Operating Systems Fall 2001 An Examination of Embedded Linux as a Real Time Operating System Mark Mahoney.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
Performance Evaluation of Real-Time Operating Systems
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
Introduction to Embedded Systems
Supporting Time-Sensitive Applications on a Commodity OS A. Goel, L. Abeni, C. Krasic, J. Snow and J. Walpole Proceedings of USENIX 5th Symposium on Operating.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Linux and Real Time Real-time systems are characterized by deadlines. When a missed deadline results in inconvenience or a diminished customer experience,
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
Håkan Sundell, Chalmers University of Technology 1 Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers)
Scheduling policies for real- time embedded systems.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
BFSBFS by Con KolivasCon Kolivas Guruprasad Aphale. Real Time Lunch, 10/21/ Guruprasad Aphale.
Kernel Locking Techniques by Robert Love presented by Scott Price.
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Real Time System with MVL. © 2007 MontaVista Confidential | Overview of MontaVista Agenda Why Linux Real Time? Linux Kernel Scheduler Linux RT technology.
CS333 Intro to Operating Systems Jonathan Walpole.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Interrupt Handler Migration and Direct Interrupt Scheduling for Rapid Scheduling of Interrupt-driven Tasks Reviewer: Kim, Hyukjoong ESLab.
Soft Timers : Efficient Microsecond Software Timer Support for Network Processing - Mohit Aron & Peter Druschel CS533 Winter 2007.
Real-Time Operating Systems RTOS For Embedded systems.
Real-Time Performance of Linux “A Measurement-Based Analysis of the Real-Time Performance of Linux” (L. Abeni, A. Goel, C. Krasic, J. Snow, J. Walpole)
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Introduction to Real-Time Operating Systems
Mohit Aron Peter Druschel Presenter: Christopher Head
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Limited Direct Execution
Lecture 12: Real-Time Scheduling
Linux Realtime Preemption and Its Impact on ULDD* - Progress Report -
CS 6560: Operating Systems Design
Presented by Kristen Carlson Accardi
Faster Data Structures in Transactional Memory using Three Paths
Chapter 8 – Processor Scheduling
Real Time Operating System
Real-time Software Design
Chapter 6: CPU Scheduling
Threads and Data Sharing
Lecture 2 Part 2 Process Synchronization
CS703 – Advanced Operating Systems
Supporting Time-Sensitive Applications on a Commodity OS
CS333 Intro to Operating Systems
CSE 153 Design of Operating Systems Winter 2019
COMP755 Advanced Operating Systems
Presentation transcript:

Supporting Time Sensitive Application in a Commodity OS Ashvin Goel, Luca, Charles, Jim, Jonathan Walpole Oregon Graduate Institute, Portland Presented by Emalayan

Agenda Problem Definition Design Objectives Solution - TSL – Firm Timers – Preemptable kernel – Efficient schedular design Resutls System overhead analysis Conclusion

Problem Identification Real Time systems: – Must meet an exact deadline – Failure to meet deadline means system failure – E.g (car engine, air crafts) Time Sensitive Applications: – Application with real-time requirements – Examples: A/V media, soft modems – Emphasis on: Timing – e.g: periodic execution with low jitter

Problem Identification Time sensitivity constraint of Commodity operating systems. Real-time systems not good at throughput applications. Limited throughput of Real-time systems. General purpose OS should offer both Time Sensitivity and high throughput.

Design Objectives Providing efficient support for time-sensitive applications in a commodity OS without considerably degrading the performance of traditional throughput oriented applications.

Execution Sequence – In Commodity OS Timer Latency – depends on the clock frequency Pre-emption latency – time taken to interrupt kernel’s current activity and enable the schedular Scheduling Latency – Time taken to schedule the event Time Wall-clock time event Timer Interrupt Scheduler Application Scheduled (Activation) Interrupt Handler Another app Scheduled Timer Latency Preemption Latency Scheduling Latency

Solution – Time Sensitive Linux A system with following future -Very low timer latency - Responsive Kernel with Fine-Grained pre-emptibility -CPU scheduling algorithm Low timer Latency Low preemption Latency Low scheduler latency TSL

Timer Latency Different type of timers – Periodic timers High frequency increase interrupt overhead. Low frequency yield poor performance for real time. – One shot timers Interrupts only when needed Cost of re-programming High cost of interrupts – used frequently – Soft timers Cost of polling for the event May have delays due to polling – Firm Timers Combine all the advantages of above timers Low over head

Firm timers Hybrid approach Combination of one shot timer and soft timer Uses APIC one shot timers in Intel Pentium Taken from

Function of Firm Timers Time System call Time-Sensitive Application ready For execution One-shot timer expiry Poll for timer expiry Overshoot Parameter Reprogram One-shot timer and fire the event Timer Latency

Fine Grained Preemptible Kernel Bottleneck – Length of non preemptible sections Solutions – Explicit insertion of preemption points – Any time preemption Using spin locks for shared data – Anytime preemption by means of acquiring and releasing locks (Robert Love’s lock breaking kernel)

Fine Grained Preemptible Kernel MethodsAdvantageDisadvantage Explicit preemption- Fine grained preemptibility - Explicit points should be inserted in system calls Any time preemption (using spin locks) - Easy Implementation - Independent of system call paths -Poor performance with large shared data Robert Love’s lock breaking kernel (acquire/ release / re acquire) - Fine grained preemptibility - Modification to the existing kernel ???

CPU scheduling Proportion based CPU scheduling – Each task is allocated a fixed proportion of time – Provides Temporal Protection If a task over runs only the task itself will suffer possible consequences – Difficult to determine proportion Priority based CPU scheduling – Real time priorities are assigned to time sensitive tasks based on application needs

TSL scheduling model According to the application needs Real-time priorities are given Based on Highest locking priority protocol (HLP) to cope with priority inversion if(Only fixed priority tasks are accessing X Server) {schedule X Server with maximum priority} else {schedule the proportion-priority task with high priority}

Results Setup: – Linux (using Firm timers mentioned earlier) – Robert Love’s lock-breaking preemptible kernel patch – Proportion-period scheduler – 1.5 GHz Intel P4 – 512 MB RAM

Results Micro Benchmarks – Evaluated timer latency and pre-emption latency – Using nanosleep() – Measured sleeping time – Maximum latency < 1ms Average linux kernel latency > 15 ms

Real time application latency - Mplayer Audio/video skew on Linux and TSL with user-level CPU load

Real time application latency - Mplayer Audio video skew on Linux and on TSL with kernel CPU Load Latency measured by audio/video synchronization skew

Real time application latency - Proportion period scheduler Deviation in proportion and period when two process are run under the proportion period scheduler in TSL

System overhead analysis – preemption checks Memory Access – TSL overhead.42 +/-.18% Fork – TSL overhead.53 +/-.06% File System Access – TSL no significant overhead Overhead of checking for preemption points in TSL low

System overhead analysis – Firm Timers

Conclusion TSL provides ideal real time support by means of – Firm Timers, Pre-emptable kernel, Proportion based scheduler. TSL can be used in both time sensitive and throughput oriented application TSL needs further investigation – Interrupt service time – Network processing latency – Fine grained accounting time

THANK YOU

Questions 1.They talk about releasing and re-acquiring kernel locks to allow pre-emption ok kernel threads. Wouldn't this mean that a whole lot of assumptions that have been made may no longer hold when the lock is acquired again and need to be verified. What is the overhead of such checks and how much reprogramming of the OS do they require? 2.For proportion based scheduling they need to know the time required for correct execution. While this may be ok in an RTOS world, how does it translate for a general purpose operating system?

Questions 3. The Soft Timer paper by Aron and Druschel already dictates the use of the hardware timer to provide an upper bound on delay. Why do the authors seem to make the greater claim, when their contribution is actually limited to replacing the periodic timer with a frequently reprogrammed one-shot timer? 4. One of the ideas described in this paper, one-shot timers, has been implemented in the Linux kernel. However, this feature was not implemented for the sake of real-time guarantees. It was implemented to save power by avoiding unnecessary wakeups. Does the implementation of one- shot timers (called "tickless system" in the Linux kernel) also grant the benefits described in this paper, or not?

Questions 6. There is further complexity added when they combine explicit preemption and the preemptible kernel approach by releasing and reacquiring spin-locks at strategic points. This takes relatively simple code and makes it hard to verify. The implementation effort could be even more difficult in a bigger OS where the kernel has much shared data.How would this system be modified to support multi-core machines?

Questions 7. How can prove that the soft timer is approximate to the event happens to the system? How to predict the event? 8. If there is a malicious process that request the resource all the time, does it mean that the TSL always allocate it to the highest priority? 9. Nowadays, the CPU is much faster than the time this paper written, and therefore high frequency interrupt of timer is allowed (1ms now). So do you think we still need such kind of work to support more time-sensitive applications?

Questions 10. The author claimed that traditional commodity kernels disable preemption for the entire period of time when a thread in the kernel. Why most kernels forbid these preemption? What is trade off between allow or disable preemption inside the kernels?

Questions 11. Priority Inversion The authors note that many applications many require soft real-time scheduling and must interact with other processes. The authors claim that the HLP protocol fixes their X server problem. Is this actually the case? will this cause the X server to run at real-time prioity to do work for non real-time processes? Feedback Scheduler (section 4.4.2) Their scheduler relies on an application specific metirc to indicate progress, yet they do not discuss this at length. Their example of a bounded buffer as a metric is also a bit dubious as it seems to 'know‘ that the 'progress' of two precesses is related. Do we buy this? Timer Overshoot Timer Overshoots allow the OS to impose a hard deadline on the scheduling of an event. The window between the actual event deadline and the timer overshot is a window in which soft timers may be used to schedule an event. This guarantees that an event will always be delivered a little later that scheduled. Why didn't the authors attempt to deliver events a little earlier as well?

Questions 12. I wonder if there can be a pure one-shot or soft timer mechanism, which doesn’t get involved with periodic timer, being able to handle all events well? 13. It is said in the paper that a real-rate scheduler uses an application specific progress rate metric to assign correct allocations to tasks. Will this notion conflicts with the goal of TSL that runs on a general commodity OS?