The Real-Time Execution Performance Agent An Hard/Soft Real-Time Digital Control and Continuous Media Experiment to Demonstrate Confidence-Based Scheduling With The RT-EPA Execution Control Interface Sam Siewert siewerts@rodin.colorado.edu Motivation for RT-EPA • Emerging Soft Real-Time Applications – Virtual Reality, Multimedia, Flexible Automation and Control • Device Interfaces with RT Processing Between Them – Range of Device Bandwidths and Characteristics Aperiodic Bursty Periodic – Range of RT Performance Reliability Required Best-Effort Confidence-Based Guaranteed • Negotiated Service & Control of Kernel Processing Pipelines – Kernel Pipeline Efficiency Well-Demonstrated (Fall & Govindan) – Use Real-Time Kernel Threads and Provide Trades between Utilization and Expected Number of Deadline Misses Problems Addressed and Approach • “Soft” Real-Time - Confidence-Based Scheduling – Not Guaranteed, Not Best Effort -- Probabilistic Predictability – Can Deadline Confidence Be Derived from Execution Time Confidence? -- Deadline Monotonic Confidence Extension – Can WCET Hard Real-Time Requirement be Relaxed? -- Execution Time Model (Confidence Interval, Distribution) – 99.9% of Deadlines are Met Given 99.9% Execution Time Confidence, Release Frequency, and Interference • Service Negotiation & Execution Control - EPA/PCIP – Can Execution Parameter Changes Be Handled Maintaining (Degrading) Deadline Confidences? -- Parametric Monitoring and Re-estimation of Confidences – Can Application Modify Service On-Line? -- Dynamic Admission RT EPA/PCIP Design Issues • Required RT-EPA Kernel Interface – Required Kernel Features (POSIX 1003.4 not sufficient) • Priority Preemptable Kernel-level Threads, Priority Inversion Control, VM Page Wiring, and Kernel-space Modules • Simple Implementation in single-user RTOS (e.g. VxWorks) • More complex Implementation in multi-user OS (e.g. Solaris) possible given required features – Portable RT “Kernel-Ware” modules (trusted like driver code) • EPA Service Negotiation Interface and Control – – – – – Soft and “Termination” Deadlines and Confidences (Computed) Execution Time Models (Distribution Assumption or Free) Output Hold (Buffering) for Isochrony Parameter Change Confidence Re-estimation (C(i), T(i), D(i)) Confidence and Deadline Management (Preserve Negotiated Confidences, Signal Inability to Maintain Negotiation) RT EPA Interface Design Low Frequency Interaction (Parameter Initialization and Modification) Application system call kernel API Execution Performance Agent High-Frequency Interaction and Per-Block Processing Device Interface Pipe-Stage Filter Device Interface HW / SW Interface Source Device Sink Device 5 DOF Robot RTEPA Application Robot Control Execution Performance Agent ARM POS RELAY SHOULDER POS RELAY WRIST POS RELAY ELBOW POS RELAY BASE POS RELAY RACE RTEPA Application RACE Control Execution Performance Agent RAMP RANGE CAMERA RAMP CONTROL 68HC11 YAW CONTROL 68HC11 YAW DIGITAL COMPASS RT EPA Confidence-Based Scheduling earliest possible response earliest desired response desired optimal response latest desired response response utility release start time termination response failure: dropout degradation response damage time utility curve desired response interval WCET Cexpected d context switch overhead computation time distribution best-case execution hold early response Rmin buffered response Ropt buffered response Clow , Dsoft signal Chigh , Dterm signal and abort Extended Deadline Monotonic Equations • 3 Basic Equations (sufficient but not necessary) 1) Clow and Chigh from distribution equation 2) EPA Deadline-monotonic admission test inequality given interference from current thread pool 3) Maximum Interference from current thread pool See www-sgc.colorado.edu/people/siewerts for detailed example • Termination deadline required for equations to work • Pessimistic interference assumption (required for hard or mixed hard/soft real-time) – All interfering threads run to their termination deadline every release – Worst case interference • Reliable interference assumption (for soft real-time only) – All interfering threads are assumed to run to high confidence Cexp RT-EPA Interface • Pipeline task required inputs for admission – – – – – – – – Entry point function pointer; Fptr Release source; ISR signal or interval timer RT POSIX signal Expected release period; Texp Expected periodic execution time; Cexp Execution time model; <sample array> or <noraml dist s> Desired soft and hard termination deadlines; Dsoft and Dterm Desired soft and hard deadline confidences; Conf-soft, Conf-hard Output description and period; Dptr, size, Dest-addr, Tout • Returns – Soft and hard deadline confidence (actual or maximum possible given current thread pool) • Monitors & Controls – – – – Actual execution time Actual release times Missed soft and hard deadlines Termination of threads at Dterm RT-EPA Implementation and Evaluation • Demonstration RT EPA Implemented as VxWorks Task – EPA spawns and controls tasks (internal or interrupt release) – Provides message queue interface for service negotiation – Modeled as hard real-time periodic itself • RACE (Rail-guided, Air-powered, Control Experiment) – 2 68HC11 microcontrollers (navigation and propulsion), 3 PWM servos, ultrasonic range finder, digital compass, and color CCD camera • EPA Experiments – Continuous Media : Qcam CCD frame processing for range determination (knowledge of range to 0.5 inches every second) – Continuous Control : Ramp position keeping (Qcam range input, serial motor servo output), RACE yaw control (digital compass input, serial motor servo output) • Expected Outcome – Demonstration of EPA Negotiation Interface for Multiple Active Pipelines (on-line tradeoffs by application using EPA) RACE RT-EPA Experiment Setup RACE Vehicle Close-up RACE Rail-guided Carriage RACE Ramp Ascent RACE Optical Target at Minimum Range RACE Optical Target at Full Range Summary • Confidence-Based Scheduling (Extension of Deadline Montonic Equations) used for Hard-to-Soft RT execution control • EPA Interface Between Applications and Kernel Thread Scheduler – Parametric Control of Kernel Threads through EPA (E.g. Terminated or Allowed to Overrun Soft Deadline) – Tradeoffs through EPA for Application with Multiple Pipelines (Lower Video Confidence for Higher Control Confidence) • Previous Work on In-Kernel Pipelines – EPA/PCIP Extends In-Kernel Pipelines for Control, Service Negotiation, and Confidence-Based Scheduling – EPA Monitors Execution Time Models and Release Frequency For Changes (Confidence Re-estimation)