Defects of the POSIX Sporadic Server and How to Correct Them

Slides:



Advertisements
Similar presentations
Priority Inheritance and Priority Ceiling Protocols
Advertisements

Introduction to Embedded Systems Resource Management - III Lecture 19.
CSE 522 Real-Time Scheduling (4)
Balancing Throughput and Latency to Improve Real-Time I/O Service in Commodity Systems Mark Stanovich 1.
RUN: Optimal Multiprocessor Real-Time Scheduling via Reduction to Uniprocessor Paul Regnier † George Lima † Ernesto Massa † Greg Levin ‡ Scott Brandt ‡
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Soft Real-Time Semi-Partitioned Scheduling with Restricted Migrations on Uniform Heterogeneous Multiprocessors Kecheng Yang James H. Anderson Dept. of.
Sporadic Server Scheduling in Linux Theory vs. Practice Mark Stanovich Theodore Baker Andy Wang.
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
Chapter 6 Dynamic Priority Servers
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Fixed-Priority Servers
Supporting Time-sensitive Application on a Commodity OS By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Shuping Tien.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Job scheduling Queue discipline.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
New Challenges in Cloud Datacenter Monitoring and Management
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Probabilistic Preemption Control using Frequency Scaling for Sporadic Real-time Tasks Abhilash Thekkilakattil, Radu Dobrin and Sasikumar Punnekkat.
Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able.
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.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Traditional UNIX Scheduling Scheduling algorithm objectives Provide good response time for interactive users Ensure that low-priority background jobs do.
Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
Scalable and Coordinated Scheduling for Cloud-Scale computing
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Introduction to Real-Time Systems
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Introductory Seminar on Research CIS5935 Fall 2008 Ted Baker.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
Soft Timers : Efficient Microsecond Software Timer Support for Network Processing - Mohit Aron & Peter Druschel CS533 Winter 2007.
OPERATING SYSTEMS CS 3502 Fall 2017
lecture 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5a: CPU Scheduling
Unit OS9: Real-Time and Embedded Systems
Process Scheduling B.Ramamurthy 9/16/2018.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Houssam-Eddine Zahaf, Giuseppe Lipari, Luca Abeni RTNS’17
CPU Scheduling Basic Concepts Scheduling Criteria
Chapter 6: CPU Scheduling
Chapter 6 Dynamic Priority Servers
Process Scheduling B.Ramamurthy 12/5/2018.
CSCI1600: Embedded and Real Time Software
Chapter 6: CPU Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Uniprocessor scheduling
Process Scheduling B.Ramamurthy 4/19/2019.
Chapter 6: CPU Scheduling
Ch.7 Scheduling Aperiodic and Sporadic Jobs in Priority-Driven Systems
Chapter 6: CPU Scheduling
Presentation transcript:

Defects of the POSIX Sporadic Server and How to Correct Them Mark Stanovich Theodore Baker An-I Wang Florida State University, USA Michael González Harbour Universidad de Cantabria, Spain

Overview POSIX specification broken Budget amplification (accounting error) Interference can grow over time Premature replenishment Invalidates sliding window budget constraint Incomplete temporal isolation No way to limit low priority execution

Motivation Sporadic server (SS) is well known1 Many uses Bounds interference for other tasks Service device drivers Composable systems Only POSIX policy that limits CPU time Alternatives (CBS, TBS, …) Not for fixed-priority systems 1 Sprunt, Sha, and Lehoczky. Aperiodic task scheduling for hard real-time systems.

Sporadic Server Used to service aperiodic jobs in fixed-priority task scheduling Interference like a periodic task Period = replenishment period Execution time = initial budget Average response time < polling server Interference < deferrable server

(work available for server) Replenishment Policy replenishment period replenishment initial budget time activation time (work available for server) 5

Bandwidth Preservation replenishment period replenishment initial budget time activation time (work available for server) 6

SCHED_SPORADIC POSIX variant Differences Conceptually similar to Sprunt SS Differences Allows overruns Max execution ≤ available budget + clock resolution Maximum number of pending replenishments Background priority

Differences Break Model Budget amplification Premature replenishment Incomplete temporal isolation

Budget Amplification Accounting error Overruns not always charged to the server Max execution ≤ server budget + clock res. “if the available execution capacity would become negative...it shall be set to zero”

Budget Amplification 10

Is this a problem in real systems?

Budget Amplification Experiment Linux sporadic server implementation Replenishment period = 10 msec Budget = 1 msec Budget breaks into 2-8 chunks 12

13

How likely is this? Simulate large number of cases Exponential workload distribution Mean job execution time = 10 Various mean interarrival times Server Replenishment period = 120 Budget = 40 Job overruns = 1 time unit Maximum utilization = 34% 14

15

Solutions Just allow negative available capacity? Our solution But overruns can still occur every period Our solution Think of overrun as time received early Charge against future replenishments

17

Premature Replenishment Illegal merging of chunks Violates minimum offset Exceeds sliding window budget constraint Single activation time is oversimplification

Premature Replenishment

Premature Replenishment Simulation Experiment Two tasks Sporadic server Replenishment period = 100 Budget = 42 Higher priority periodic task Period = 141 Execution time specified by x-axis Intuition Longer preemption period can trigger illegal merging of time chunks 20

21

Is this likely? Difficult to demonstrate on random arrivals and execution times Effect does not occur often enough to be measured on a macroscopic scale This anomaly would probably be only a concern in a hard real-time environment 22

Solutions Maintain all replenishments separately? Unbounded fragmentation Merging chunks essential Limits fragmentation Must not merge illegally Preserve additional activation times

Premature Replenishment 15 minute point If running behind cut 17-21

25

Lessons Learned Transforming a theoretical algorithm into an implementation is not trivial Practical considerations Overruns Maximum number of replenishments …

Lessons Learned Implementation deviation from theoretical model invalidates schedulabilty analysis Analysis must be extended to match implementable reality Implementation must be analyzable 27

Conclusion POSIX formulation of SS broken Provided possible corrections Need a standard scheduling policy that enforces time budgets API for SCHED_SPORADIC with correct semantics can serve the purpose

Thank You! Questions?

Defect #3: Incomplete Temporal Isolation With temporal isolation a failure in one task does not prevent others from meeting their timing constraints Problem: Execution at low priority Still preempts non-”real-time” work 30

Unreliable Temporal Isolation Highest Priority SCHED_FIFO SCHED_RR SCHED_SPORADIC SCHED_OTHER Lowest Priority 31

Unreliable Temporal Isolation No upper bound on execution time consumed by SCHED_SPORADIC task Even though SCHED_OTHER tasks are not RT, should allow a mechanism to isolate from overruns of SCHED_SPORADIC threads 32

Unreliable Temporal Isolation Some remedies Background execution of SCHED_SPORADIC Only use idle time Interleave with non-real-time priorities Never execute at background priority Utilize numeric priority to specify functionality 33

Solution Highest Priority SCHED_SPORADIC (background priority) SCHED_FIFO SCHED_RR SCHED_SPORADIC (high priority) SCHED_OTHER Lowest Priority Idle No execute 34

Sprunt Defect

Overview Aperiodic Tasks Arrivals and executions are generally considered random No bound on the CPU runtime Typically scheduled with a server thread to bound CPU consumption and ease analysis

Aperiodic Server Given a budget which it consumes while executing aperiodic jobs Budget is replenished according to the server's rules Typically the server's impact is analyzed by some equivalent periodic task Examples of fixed-priority servers Polling Server Deferrable Server Sporadic Server

Polling Server Ts replenishment server budget time job arrival Server activations every period (Ts) ti+1 – ti = Ts

Primitive Sporadic Server Ts replenishment server budget time job arrival Server activations lower bounded by the period (Ts) ti+1 – ti ≥ Ts

Sporadic Server Parameters Replenishments performed in chunks Execution budget (Cs) Replenishment period (Ts) Server priority Replenishments performed in chunks Used execution time is replenished Ts in the future from the server activation

POSIX Portable Operating System Interface [for uniX] Standard that defines a set of services that an operating system provides to an application Eases portability of applications from one platform to another Widely implemented Linux Mac OS X OpenBSD FreeBSD … Some interfaces are optional (e.g. SCHED_SPORADIC)

Budget Amplification Occurs during overload when all budget is continuously consumed With small enough fragments, a server can achieve an execution capacity arbitrarily close to 100% POSIX only limits the available execution capacity to the initial budget Overruns can happen Control of execution on the processor cannot be assumed to be perfect If overruns do occur, then some fairness mechanism should be used

sched_ss_repl_period SCHED_SPORADIC sched_ss_repl_period replenishments pending limited to sched_ss_repl_max replenishments sched_ss_init_budget time activation time Current budget limited to sched_ss_init_budget

Evaluation Linux implementation Also, simulator Allows reduction of “noise” from implementation Demonstrate effects and effectiveness of proposed solutions Budget amplification Premature replenishment

Effects of Budget Amplification Experiment does not reach 100% CPU utilization due to replenishments overlapping and therefore merged Merging two chunks that exceed the initial budget must be rounded down to the initial budget While there is a bound it still exceeds the load of an equivalent periodic task