Proportional Share Resource Allocation Outline. Proportional Share Resource Allocation Concept

Similar documents
Module 5: CPU Scheduling

Chapter 6: CPU Scheduling

CPU SCHEDULING RONG ZHENG

CPU Scheduling Exercises

CPU scheduling. CPU Scheduling

CPU Scheduling. CPU Scheduler

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

AS computer hardware technology advances, both

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

2/5/07 CSE 30341: Operating Systems Principles

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

On the Soft Real-Time Optimality of Global EDF on Multiprocessors: From Identical to Uniform Heterogeneous

Scheduling Lecture 1: Scheduling on One Machine

Embedded Systems 14. Overview of embedded systems design

CSE 380 Computer Operating Systems

Scheduling I. Today Introduction to scheduling Classical algorithms. Next Time Advanced topics on scheduling

Scheduling Lecture 1: Scheduling on One Machine

Multiprocessor Real-Time Scheduling Considering Concurrency and Urgency

Schedulability analysis of global Deadline-Monotonic scheduling

Real-Time Systems. Event-Driven Scheduling

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

Tardiness Bounds under Global EDF Scheduling on a Multiprocessor

EDF Scheduling. Giuseppe Lipari May 11, Scuola Superiore Sant Anna Pisa

CHAPTER 5 - PROCESS SCHEDULING

Real-Time Systems. Event-Driven Scheduling

Accuracy versus Migration Overhead in Real-Time Multiprocessor Reweighting Algorithms

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Embedded Systems - FS 2018

CIS 4930/6930: Principles of Cyber-Physical Systems

Process Scheduling. Process Scheduling. CPU and I/O Bursts. CPU - I/O Burst Cycle. Variations in Bursts. Histogram of CPU Burst Times

Generalized Network Flow Techniques for Dynamic Voltage Scaling in Hard Real-Time Systems

Online Scheduling Switch for Maintaining Data Freshness in Flexible Real-Time Systems

Networked Embedded Systems WS 2016/17

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Resource Sharing in an Enhanced Rate-Based Execution Model

EDF Scheduling. Giuseppe Lipari CRIStAL - Université de Lille 1. October 4, 2015

Andrew Morton University of Waterloo Canada

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

Real-Time Scheduling. Real Time Operating Systems and Middleware. Luca Abeni

Group Ratio Round-Robin: O(1) Proportional Share Scheduling for Uniprocessor and Multiprocessor Systems

EDF Feasibility and Hardware Accelerators

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

Special Nodes for Interface

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Downlink Traffic Scheduling in Green Vehicular Roadside Infrastructure

A Theory of Rate-Based Execution. A Theory of Rate-Based Execution

Predicting Time-Delays under Real-Time Scheduling for Linear Model Predictive Control

Clock-driven scheduling

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Rate-monotonic scheduling on uniform multiprocessors

Energy-efficient Mapping of Big Data Workflows under Deadline Constraints

Energy-Efficient Real-Time Task Scheduling in Multiprocessor DVS Systems

On Two Class-Constrained Versions of the Multiple Knapsack Problem

Real-time scheduling of sporadic task systems when the number of distinct task types is small

Real-Time and Embedded Systems (M) Lecture 5

An Optimal Real-Time Scheduling Algorithm for Multiprocessors

System Model. Real-Time systems. Giuseppe Lipari. Scuola Superiore Sant Anna Pisa -Italy

Tardiness Bounds under Global EDF Scheduling on a. Multiprocessor

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

Real-Time Scheduling and Resource Management

On the Design and Application of Thermal Isolation Servers

Non-Work-Conserving Non-Preemptive Scheduling: Motivations, Challenges, and Potential Solutions

Exam Spring Embedded Systems. Prof. L. Thiele

Design and Analysis of Algorithms

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas January 24, 2014

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

CS 550 Operating Systems Spring CPU scheduling I

On-line scheduling of periodic tasks in RT OS

Multiprocessor Scheduling I: Partitioned Scheduling. LS 12, TU Dortmund

Aperiodic Task Scheduling

CycleTandem: Energy-Saving Scheduling for Real-Time Systems with Hardware Accelerators

Task Models and Scheduling

arxiv: v3 [cs.ds] 23 Sep 2016

CSE 421 Greedy Algorithms / Interval Scheduling

Simulation of Process Scheduling Algorithms

An EDF-based Scheduling Algorithm for Multiprocessor Soft Real-Time Systems

There are three priority driven approaches that we will look at

QFQ: Efficient Packet Scheduling with Tight Bandwidth Distribution Guarantees

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #7: More on Uniprocessor Scheduling

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017

Embedded Systems Design: Optimization Challenges. Paul Pop Embedded Systems Lab (ESLAB) Linköping University, Sweden

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

An Efficient Energy-Optimal Device-Scheduling Algorithm for Hard Real-Time Systems

The preemptive uniprocessor scheduling of mixed-criticality implicit-deadline sporadic task systems

Performance and Scalability. Lars Karlsson

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

CS 161: Design and Analysis of Algorithms

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

Complexity of Routing Problems with Release Dates and Deadlines

Efficient Workplan Management in Maintenance Tasks

Uniprocessor Mixed-Criticality Scheduling with Graceful Degradation by Completion Rate

A 2-Approximation Algorithm for Scheduling Parallel and Time-Sensitive Applications to Maximize Total Accrued Utility Value

Transcription:

Proportional Share Resource Allocation Outline Fluid-flow resource allocation models» Packet scheduling in a network Proportional share resource allocation models» CPU scheduling in an operating system On the duality of proportional share and traditional real-time resource allocation models» How to make a provably real-time general purpose operating system Proportional Share Resource Allocation Concept Processes are allocated a share of a shared resource» a relative percentage of the resource s total capacity Processes make progress at a uniform rate according to their share OS Example time sharing tasks allocated an equal share (/n th ) of the processor s capacity» round robin scheduling, fixed size quantum P P 2 P 3 0 q 2q 3q 4q 5q 6q 7q 8q 9q 0q q 2q 3q 2

Proportional Share Resource Allocation Formal model Processes are allocated a share of the processor s capacity» Process i is assigned a weight w i» Process i s share of the CPU at time t is f i (t) = If processes weights remain constant in [t, t 2 ] then process i receives w i S i (t,t 2 ) = t 2 fi (τ) dt = (t 2 - t ) t Σ w j j units of execution time in [t, t 2 ] w i 3 Proportional Share Resource Allocation Real-time scheduling example Periodic tasks allocated a share equal to their processor utilization c/p» round robin scheduling with infinitesimally small quantum T = (2, 8) T 2 = (3, 6) 0.25 0.5 0 2 3 4 5 6 7 8 9 0 2 3» with integer quantum = 2 time units T = (2, 8) T 2 = (3, 6).0 0.5 0 2 3 4 5 6 7 8 9 0 2 3 4

Proportional Share Resource Allocation Task scheduling metrics & goals S i (t,t 2 ) s i (t,t 2 ) Fluid Allocation Quantum Allocation Schedule tasks such that their performance is as close as possible to their performance in the fluid system S i (t,t 2 ) = t 2 w i t dτ Define the allocation error for task i at time t as lag i (t) = S i (t 0,t) s i (t 0,t) 5 Proportional Share Resource Allocation Task scheduling metrics & goals S i (t,t 2 ) s i (t,t 2 ) Fluid Allocation Quantum Allocation lag i (t) = S i (t 0,t) s i (t 0,t) Because allocation is quantum-based, tasks can be either behind or ahead of the fluid schedule» if lag is negative then a task has received more service time than it would have received in the fluid system» if lag is positive then a task has received less service time than it would have received in the fluid system 6

Proportional Share Resource Allocation Task scheduling metrics & goals S i (t,t 2 ) s i (t,t 2 ) Fluid Allocation Quantum Allocation lag i (t) = S i (t 0,t) s i (t 0,t) Goal: Schedule tasks such that their performance is as close as possible to that in the fluid system Schedule tasks such that the lag is:» bounded, and» minimized over all tasks and time intervals 7 Scheduling to Bound Lag The virtual time domain Tasks are scheduled in a virtual time domain V(t) = 0 t dτ Virtual V(t) t = t t > t < t t t t Real- 8

Scheduling to Bound Lag The virtual time domain Slope of virtual time changes are tasks enter and leave the system Virtual V(t) < V(t) = 0 t dτ Real- w w 2 w 3 9 Scheduling to Bound Lag The virtual time domain Task s execute for w i real-time time units in each virtual-time time unit V(t) <» Thus ideally, task i executes for S i (t,t 2 ) = w i t 2 t dτ w Real- = (V(t 2 ) V(t ))w i w 2 time units in any real-time interval w 3 0

Scheduling to Bound Lag Virtual time scheduling principles q lag i = S i (t,t 2 ) s i (t,t 2 ) Schedule tasks only when their lag is non-negative» If a task with negative lag makes a request for execution at time t, it is not considered until a future time t' when lag(t') 0» Let e > t be the earliest time a task can be scheduled the time at which t 2 w S i i (t,t 2 ) = t S(t i, e) = s(t i, t)» This time occurs in the virtual time domain at time S(t i, e) = s(t i, t) (V(e) V(t i ))w i = s(t i, t) V(e) = V(t i ) + s(t i,t)/w i dτ Scheduling to Bound Lag Virtual time scheduling principles Task requests should not be considered before their eligible time e Requests should be completed by virtual time V(d) = V(e) + c i /w i» where c i is the cost of executing the request Our candidate scheduling algorithm: Earliest Eligible Virtual Deadline First (EEVDF) At each scheduling point, a new quantum is allocated to the eligible process with the nearest earliest virtual deadline 2

Earliest Eligible Virtual Deadline First Scheduling Example: Two tasks with equal weight = 2 (q = ) Cost = 2 (V(e),V(d)) = (0,) (,2) (2,3) real-time 0 Cost = virtual time at time 0 0 0.5 (.5,) (,.5) (.5,2) (2,2.5) 2 3 4 5 6 7 at time 0 0.5.5 2 V(t) = t 0 dτ V(e) = V(t 0 ) + s(t 0, t)/w V(d) = V(e) + c/w 3 Proportional Share Resource Allocation Issues How to use proportional share scheduling for real-time computing» How to ensure deadlines are respected in the real-time domain» Bounding the allocation error Practical considerations Maintaining virtual time» Policing errant tasks» Dealing with tasks that complete early 4

Using Proportional Share Allocation For Real- Computing Deadlines in a proportional share system ensure uniformity of allocation, not timeliness Weights are used to allocate a relative fraction of the CPU s capacity to a task f i (t) = Real-time tasks require a constant fraction of a resource s capacity f i (t) = w i c i p i Thus real-time performance can be achieved by adjusting weights dynamically so that the share remains constant 5 Supporting Real- Computing Dynamically adjusting weights c V(e) = V(t) + s(t, t)/w i = V(t) t t + d V(d) = V(e) + c/w i Consider task i that arrives at time t with a deadline at time t + d» In the interval [t, t+d] the task requires a share of the processor equal to c/d w i = c d w i = c (Σ j i w j + w i ) d w i = c Σ d j i w j c d 6

Supporting Real- Computing Admission control If real-time tasks require a fixed share of the CPU s capacity, only a finite number of tasks may be guaranteed to execute real-time Admission criterion:» a simple sufficient condition» a necessary condition?? it depends... c Σ i i d i 7 Supporting Real- Computing Bounding the allocation error Is a task guaranteed to complete before its deadline? q How late can a task be?» Theorem: By at most q time units 8

Supporting Real- Computing Bounding the allocation error Consider a task system wherein tasks always terminate with zero lag Theorem: Let d be the current deadline of a request made by task k. Let f be the actual time the request is fulfilled.» f < d + q (the request is fulfilled no later than time d + q)» if f > d then for all t, d t < f, lag k (t) < q δ < q 9 Bounding the Allocation Error Some properties of lag(t) lag i (t) = S i (t 0,t) s i (t 0,t) V(e) = V(t 0 ) + s(t 0, t)/w V(d) = V(e) + c/w lag i (t) < 0 implies that task i has received too much service, lag i (t) > 0 implies that it has received too little Eligibility law» If a task has non-negative lag then it is eligible Lag conservation law» For all t, Σ i lag i (t) = 0 Missed deadline law» If a task misses its deadline d then lag i (t) = remaining required service time Preserved lateness law» If a task that misses a deadline at d completes execution at T, then for all t, T t > d, lag i (t) > 0 lag i (t) > remaining service time 20

Bounding the Allocation Error Proof sketch of Theorem after(d) before(d) task k does not complete before its deadline t' d t f Let t' < f be the latest time a task with deadline after d receives a quantum At any time t partition tasks into those with requests with deadlines before d and those with deadlines after d Σ i in before(t') lag i (t') < 0 Σ i in after(t') lag i (t') > 0 2 Bounding the Allocation Error Proof sketch of Theorem after(d) before(d) t' t" d t f Σ i in before(t') lag i (t') < 0, Σ i in after(t') lag i (t') > 0 Σ i in after(t) lag i (t) > -q, Σ i in before(t) lag i (t) < q, lag k (t) < q Σ i in before(d) lag i (d) < q, This implies that all requests in before(d) must be completed by time d + q 22

Supporting Real- Computing Bounding the allocation error Theorem: Let c be the size of the current request of task k. Task k s lag is bounded by -c < lag k (t) < max(c, q) 23 Proportional Share Resource Allocation Issues How to use proportional share scheduling for real-time computing» How to ensure deadlines are respected in the real-time domain» Bounding the allocation error Practical considerations Maintaining virtual time» Policing errant tasks» Dealing with tasks that complete early 24

Practical Considerations Maintaining virtual time What happens when a task completes after its deadline?» Preserved lateness law: t, Τ t > d, lag i (t) > 0 If the task makes another request immediately, the request is eligible If the task terminates the total lag in the system is negative» Lag conservation law requires that t, Σ i lag i (t) = 0 25 Maintaining Virtual A task terminates with positive lag Virtual Virtual t t ' t 2 t 2 ' Real t t 2 +(t ' t ) Real Ideal system Actual system 26

Maintaining Virtual A task terminates with positive lag When task k terminates with positive lag we must:» update virtual time to the next point in time V(t) at which lag k (t) = 0» update each task s lag to reflect the discontinuities in virtual time If t k is the time a task with positive lag terminates, then lag k (t k ) V(t k ) = V(t k ') + Σj k w j lag i (t k ) = lag i (t k ') + w i lag k (t k ) Σ j k w j 27 Practical Considerations Maintaining virtual time What happens when a task completes before its deadline?» Task s lag will be negative If the task makes another request immediately, the request is ineligible If the task terminates, the termination can be delayed until the task s lag is 0» If the task correctly estimated its execution time this will occur at the task s deadline» Otherwise, this time may be either before or after its deadline 28

Practical Considerations Policing tasks What happens when a task is not complete by its deadline but its lag is negative?» The task under estimated its execution time Several alternatives:» Have the operating system issue a new request on behalf of the task» Issue a new request for the task but penalize it by reducing its weight In all cases, the errant task has no effect on the performance of other tasks! 29 Practical Considerations Bounding the allocation error in practice Theorem: Let c be the size of the current request of task k. Task k s lag is bounded by -c < lag k (t) < max(c, q) Theorem: If tasks terminate with positive lag then a task k s lag is bounded by -c < lag k (t) < max(c max, q) where c max is the largest request made by any task in the system 30

Practical Considerations Bounding the allocation error in practice Theorem: If tasks terminate with positive lag then a task k s lag is bounded by -c < lag k (t) < max(c max, q) Virtual Virtual t t ' t 2 t 2 ' Real t t 2 +(t ' t ) Real 3 Practical Considerations Bounding the allocation error in practice Theorem: If tasks terminate with positive lag then a task k s lag is bounded by -c < lag k (t) < max(c max, q)» Thus a trade-off exists between the size of a task s request (i.e., scheduling overhead) and the accuracy of allocation Corollary: If tasks requests are always less than a quantum then for all tasks k, then -q < lag k (t) < q 32

Experimental Evaluation EEVDF Implementation in FreeBSD Platform» PC compatible, 75 Mhz Pentium processor, 6 MB RAM Implementation» Replaced FreeBSD CPU scheduler» quantum = 0 ms Experiments» Non-real-time tasks making uniform progress» Speeding up and slowing down task progress by manipulating weights» Real-time execution (of non-real-time programs!) 33 Proportional Share Scheduling Example Uniform allocation to non-real-time processes Number of Iterations (x 000) 50 45 40 35 30 25 20 5 0 5 Task w = 3 client client 2 Task 2 w = 2 client 3 Task 3 w = 0 0 00 200 300 400 500 600 700 800 900 000 (msec.) Number of Dhrystone Iterations (x,000) Elapsed v. Measured (secs) Lag Lag (msec.) 20 5 0 5 0 5 0 5 client x client 2 * client 3 o lag i = q lag i = -q 20 0 00 200 300 400 500 600 700 800 900 000 (msec.) v. Elapsed (secs) 34

Proportional Share Resource Allocation Summary A real-time neutral model» Supports both real-time and non-real-time EEVDF scheduling provides optimal lag bounds (± q)» Allocation error & hence timeliness guarantees are as good as possible But maintaining virtual time is non-trivial» Better than sorting but O(n) in the worst case Unclear how to solve the integrated systems problem 35