Reservation-Based Scheduling for IRQ Threads

Similar documents
Reservation-Based Scheduling for IRQ Threads

Inferring Temporal Behaviours Through Kernel Tracing

Real Time Operating Systems and Middleware

Sporadic Server Scheduling in Linux Theory vs. Practice. Mark Stanovich Theodore Baker Andy Wang

Serving Non Real-Time Tasks in a Reservation Environment

Overview of Scheduling a Mix of Periodic and Aperiodic Tasks

Tuned Pipes: End-to-end Throughput and Delay Guarantees for USB Devices. Ahmad Golchin, Zhuoqun Cheng and Richard West Boston University

Aperiodic Servers (Issues)

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW

Faculty of Computer Science Institute of Systems Architecture, Operating Systems Group. vs. REAL-TIME SYSTEMS MICHAEL ROITZSCH

Computer Science Window-Constrained Process Scheduling for Linux Systems

Multimedia Systems 2011/2012

Multimedia-Systems. Operating Systems. Prof. Dr.-Ing. Ralf Steinmetz Prof. Dr. rer. nat. Max Mühlhäuser Prof. Dr.-Ing. Wolfgang Effelsberg

Measuring the impacts of the Preempt-RT patch

Real-Time Scheduling. Dynamic Priority Servers

How Linux RT_PREEMPT Works

Using SCHED DEADLINE in Linux. Luca Abeni

Reference Model and Scheduling Policies for Real-Time Systems

Resource Reservation & Resource Servers

6.1 Motivation. Fixed Priorities. 6.2 Context Switch. Real-time is about predictability, i.e. guarantees. Real-Time Systems

Dynamic Voltage Scaling of Periodic and Aperiodic Tasks in Priority-Driven Systems Λ

OPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! ANALYZE!!!

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS

A Capacity Sharing and Stealing Strategy for Open Real-time Systems

Real Time Linux patches: history and usage

PROBABILISTIC SCHEDULING MICHAEL ROITZSCH

REAL-TIME OVERVIEW SO FAR MICHAEL ROITZSCH. talked about in-kernel building blocks:

arxiv: v1 [cs.ro] 7 Sep 2018

G Robert Grimm New York University

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Constant Bandwidth vs Proportional Share Resource Allocation

Analysis of a Window-Constrained Scheduler for Real-Time and Best- Effort Packet Streams

Developing Real-Time Applications

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems

Overview. Sporadic tasks. Recall. Aperiodic tasks. Real-time Systems D0003E 2/26/2009. Loosening D = T. Aperiodic tasks. Response-time analysis

ADVANCED trouble-shooting of real-time systems. Bernd Hufmann, Ericsson

TrueTime: Simulation of Control Loops Under Shared Computer Resources

The University of Missouri - Columbia Electrical & Computer Engineering Department ECE4220 Real-Time Embedded Computing

NuttX Realtime Programming

Respecting temporal constraints in virtualised services

Embedded Systems: OS

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

QoS support in the X11 Window Systems

Realtime BoF Session RealTime Testing Best Practice of RealTime WG YungJoon Jung

ò mm_struct represents an address space in kernel ò task represents a thread in the kernel ò A task points to 0 or 1 mm_structs

Building a Fast, Virtualized Data Plane with Programmable Hardware. Bilal Anwer Nick Feamster

Scheduling. Don Porter CSE 306

Comparison of scheduling in RTLinux and QNX. Andreas Lindqvist, Tommy Persson,

Chapter -5 QUALITY OF SERVICE (QOS) PLATFORM DESIGN FOR REAL TIME MULTIMEDIA APPLICATIONS

Scheduling, part 2. Don Porter CSE 506

Supporting Time-sensitive Applications on a Commodity OS

Introduction. Application Performance in the QLinux Multimedia Operating System. Solution: QLinux. Introduction. Outline. QLinux Design Principles

Receive Livelock. Robert Grimm New York University

LECTURE 3:CPU SCHEDULING

Development of Real-Time Systems with Embedded Linux. Brandon Shibley Senior Solutions Architect Toradex Inc.

Why Your Application only Uses 10Mbps Even the Link is 1Gbps?

Titolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella

Kernels and Locking. Luca Abeni

The Limitations of Fixed-Priority Interrupt Handling in PREEMPT RT and Alternative Approaches

Multi-Mode Virtualization for Soft Real-Time Systems

Kernel Critical Sections

Adventures In Real-Time Performance Tuning, Part 2

RT- Xen: Real- Time Virtualiza2on from embedded to cloud compu2ng

Middleware Support for Aperiodic Tasks in Distributed Real-Time Systems

Computer Systems Assignment 4: Scheduling and I/O

CEC 450 Real-Time Systems

Multicore CPU Reclaiming: Parallel or Sequential?

Embedded Software Programming

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

Predictable Interrupt Management and Scheduling in the Composite Component-based System

Real-Time Operating Systems. Ludovic Apvrille Eurecom, office

A Comparison of Scheduling Latency in Linux, PREEMPT_RT, and LITMUS RT. Felipe Cerqueira and Björn Brandenburg

Evaluation of Real-time Performance in Embedded Linux. Hiraku Toyooka, Hitachi. LinuxCon Europe Hitachi, Ltd All rights reserved.

Distributed Operating Systems. Real-Time Systems

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Janus: A-Cross-Layer Soft Real- Time Architecture for Virtualization

Why Study Multimedia? Operating Systems. Multimedia Resource Requirements. Continuous Media. Influences on Quality. An End-To-End Problem

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition

Overview Computer Networking What is QoS? Queuing discipline and scheduling. Traffic Enforcement. Integrated services

LAST LECTURE ROUND-ROBIN 1 PRIORITIES. Performance of round-robin scheduling: Scheduling Algorithms: Slide 3. Slide 1. quantum=1:

Real-Time Performance of Linux. OS Latency

Open Source Traffic Analyzer

The different Unix contexts

Achieve Low Latency NFV with Openstack*

Real-Time Operating Systems Design and Implementation. LS 12, TU Dortmund

Introduction to Embedded Systems

Overhead-Aware Compositional Analysis of Real-Time Systems

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institution of Technology, IIT Delhi

1.1 Explain the difference between fast computing and real-time computing.

Scheduling Algorithm and Analysis

Operating System Support for Multimedia. Slides courtesy of Tay Vaughan Making Multimedia Work

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Evaluation of Real-time operating systems for FGC controls

MASTER'S THESIS. Proportional and Sporadic Scheduling in Real-Time Operating Systems. Mikael Bertlin. Luleå University of Technology

OVERHEADS ENHANCEMENT IN MUTIPLE PROCESSING SYSTEMS BY ANURAG REDDY GANKAT KARTHIK REDDY AKKATI

238P: Operating Systems. Lecture 14: Process scheduling

Lecture 24: Scheduling and QoS

OVERVIEW. Last Week: But if frequency of high priority task increases temporarily, system may encounter overload: Today: Slide 1. Slide 3.

Transcription:

Reservation-Based Scheduling for IRQ Threads Luca Abeni, Nicola Manica, Luigi Palopoli luca.abeni@unitn.it, nicola.manica@gmail.com, palopoli@dit.unitn.it University of Trento, Trento - Italy Reservation-Based Scheduling for IRQ Threads p.1/20

Overview of the Talk Introduction: problem definition Effects of interrupt handling in vanilla Linux Effects of interrupt handling on Preempt-RT Some problems are solved......but some problems are still there! We ve got to look beyond fixed priorities... Reservation-based scheduling How do CPU reservations apply to IRQ threads? Do they allow to control the impact of interrupt handlers Do they allow to control the hw devices throughput? Reservation-Based Scheduling for IRQ Threads p.2/20

Introduction Real-Time theory traditionally addressed problems related to CPU allocation......but some real-time applications also need other resources to execute Example: some time-sensitive applications need to access some hardware device respecting some temporal constraints Correct CPU scheduling is useless if the hardware device is not properly served Giving CPU time to an application is not enough if device drivers cannot execute Sometimes, device drivers can steal CPU time to applications Reservation-Based Scheduling for IRQ Threads p.3/20

Interrupt Handling Traditional kernels: ISRs and Bottom Halves Have always priority over real-time applications Can preempt real-time tasks Can steal time to real-time tasks RT kernels: interrupts served in dedicated threads Linux Preempt-RT patch: transforms ISRs and bottom halves in threads Interrupt threads can have lower priorities than real-time tasks If real-time tasks do not need to interact with hardware devices (they do not depend on the interrupt threads), the problem is solved! Problem: how to schedule the IRQ threads? Reservation-Based Scheduling for IRQ Threads p.4/20

Example - What to test Effects of device handling on real-time tasks Real-time performance: response time (affected by the kernel latency) Highest priority task: worst case response time = WCET + latency Hardware device: network card high throughput device controlling the workload is easy Someone already mentioned problems with high network load and small packets... Interesting things happen when the system is overloaded Reservation-Based Scheduling for IRQ Threads p.5/20

Example - Experimental Setup Periodic real-time task, scheduled with high priority A task with period 50ms and execution time around 20ms is used The task is scheduled with the highest real-time priority expected response time: around 20ms A non real-time task receiving a lot of traffic from the network can increase the response time of the real-time task!!! The netperf program is used The netperf server is run as non real-time it should not affect the real-time performance Reservation-Based Scheduling for IRQ Threads p.6/20

Example - Results When using 192-bytes long UDP packets, the response time of the periodic task goes to more than 100ms!!! 1 Response Times CDF Standard kernel, packet size 192 0.9 0.8 0.7 0.6 P{r < t} 0.5 0.4 0.3 0.2 0.1 0 0 20000 40000 60000 80000 100000 120000 140000 160000 t (us) Reservation-Based Scheduling for IRQ Threads p.7/20

Solution: Preempt-RT The Preempt-RT patch transforms Linux in a real-time kernel. It addresses the mentioned problem by transforming ISRs and bottom halves in threads If an IRQ thread is scheduled with a lower priority than a real-time task, then the real-time task s response time is not affected Fixes the problem, but... Fixed priority scheduling is not flexible enough! Let s see! Reservation-Based Scheduling for IRQ Threads p.8/20

Priority to the Real-Time Task Low response times, low throughput (48M bps) 1 Response Times CDF Standard kernel, packet size 192 0.9 0.8 0.7 0.6 P{r < t} 0.5 0.4 0.3 0.2 0.1 0 18000 18500 19000 19500 20000 20500 t (us) Reservation-Based Scheduling for IRQ Threads p.9/20

Priority to the IRQ Thread High throughput (74M bps), high response times 0.6 Response Times CDF Standard kernel, packet size 192 0.5 0.4 P{r < t} 0.3 0.2 0.1 0 0 100000 200000 300000 400000 500000 600000 700000 800000 t (us) Reservation-Based Scheduling for IRQ Threads p.10/20

Throughput/Latency Trade-Offs Problem: fixed priority scheduling is not flexible enough It only allows to say things like the real-time task is more important than the device driver or the device driver is more important than the real-time task How to schedule the IRQ handlers? We might want to say things like give x% of the CPU time to the device driver, or similar Resource Reservations! Reservation-Based Scheduling for IRQ Threads p.11/20

Resource Reservations Resource Reservations temporal protection Every task is allowed to use a resource for an amount of time Q s every period T s Accounting and Enforcement CPU scheduling CPU Reservations (implemented in Resource Kernels) Traditional implementations aperiodic servers Deferrable Server... Here, the Constant Bandwidth Server (CBS) is used Reservation-Based Scheduling for IRQ Threads p.12/20

The Constant Bandwidth Server The CBS is used, but every reservation-based scheduler can be used Reservations based on RM, EDF, whatever... Basic Ideas: budget decreases when the served task executes server deadline assigned to served task job arrival (wakeup) check if the last server deadline can be used budget exhausted deadline postponed Server parameters: Q i : maximum server budget : server period (soft relative deadline) T s i Reservation-Based Scheduling for IRQ Threads p.13/20

Reservation-Based Scheduling Two scheduling parameters (Q s,t s ) Q s /T s is the fraction of CPU time reserved to a task T s is the granularity of the allocation Serving an IRQ thread with a (Q s,t s ) reservation: Reducing Q s /T s, the impact of interrupt handling on real-time tasks can be reduced... T s allows to control the device s responsiveness We have some theoretical analysis Reservation-Based Scheduling for IRQ Threads p.14/20

Reservations and IRQ threads Example: RSV 1 = (4, 10) for the periodic task, RSV 2 = (4, 10) for the hard IRQ, RSV 3 = (1.5, 10) for the netperf server Throughput: 74M bps Worst-Case Response Time: 46ms 1 Response Times CDF Standard kernel, packet size 192 0.9 0.8 0.7 0.6 P{r < t} 0.5 0.4 0.3 0.2 0.1 0 32000 34000 36000 38000 40000 42000 44000 46000 t (us) Reservation-Based Scheduling for IRQ Threads p.15/20

Latency / Throughput Trade-Offs Example: The response time can be reduced by using RSV 1 = (5, 10), RSV 2 = (2, 10), RSV 3 = (1, 10) Throughput: 65M bps; Worst-Case Response Time: 36ms 1 Response Times CDF Standard kernel, packet size 192 0.9 0.8 0.7 0.6 P{r < t} 0.5 0.4 0.3 0.2 0.1 0 24000 26000 28000 30000 32000 34000 36000 t (us) Reservation-Based Scheduling for IRQ Threads p.16/20

Controlling the Throughput Example: The CBS parameters (Q s,t s ) can be used to control the network throughput Non-overloaded system (larger UDP packets): 100 Network Throughput 90 80 70 Throughput (Mbps) 60 50 40 30 20 10 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 Reserved fraction of CPU Q / T Reservation-Based Scheduling for IRQ Threads p.17/20

Controlling the Network Latency - 1 Up to now we considered: Latency / Response Time for the real-time task Network throughput What about network latency? The server period T s can be used to control the response time for network packets Tested by looking at the ping RTT RTT as a function of the CBS parameters Reservation-Based Scheduling for IRQ Threads p.18/20

Controlling the Network Latency - 2 min avg max mdev Q s T s RTT RTT RTT RTT 1ms 3ms 0.062 0.109 16.498 0.289 2ms 6ms 0.057 0.105 36.504 0.368 3ms 9ms 0.058 0.103 38.684 0.379 4ms 12ms 0.058 0.101 50.991 0.428 5ms 15ms 0.059 0.102 50.928 0.453 6ms 18ms 0.058 0.103 52.814 0.507 7ms 21ms 0.059 0.104 79.782 0.566 Average and minimum RTT values do not depend on T s... But worst case values do!!! Reservation-Based Scheduling for IRQ Threads p.19/20

Conclusions Device drivers (interrupt handlers) can affect the schedulability of real-time tasks Real-time systems allow to schedule interrupt handlers Problem: how to schedule the IRQ threads? Fixed priorities are not flexible enough Low latencies low device throughput High device throughput high latencies Reservation-based scheduling allows to find trade-offs between latencies and throughput!!! Also allows to control the device throughput / response times Reservation-Based Scheduling for IRQ Threads p.20/20