Rate-Based Resource Allocation EMSOFT 2001 The case against static priority scheduling ◆ Static priority scheduling in general, and Rate Monotonic Rate-Based Resource Allocation scheduling in particular, dominates in the real-time Models for Real-Time Computing systems literature » VxWorks, VRTX, QNX, pSOSystems, LynxOS all support static priority scheduling Kevin Jeffay Steve Goddard ◆ Does one size fit all? Department of Computer Science Computer Science & Engineering Department of Computer Science Computer Science & Engineering University of North Carolina University of Nebraska – Lincoln University of Nebraska – Lincoln University of North Carolina » “When you have a hammer, everything looks like a nail” at Chapel Hill at Chapel Hill goddard goddard@ @cse cse. .unl unl. .edu edu jeffay@ @cs cs. .unc unc. .edu edu jeffay ◆ Problems with static priority scheduling » Feasibility is dependent on a predictable environment and well- behaved tasks. http://www.cs.unc.edu/Research/dirt 1 2 The Case Against Priority Scheduling Rate-Based Resource Allocation Example: Display-side multimedia processing Overview ◆ The problem: Acquire » How to allocate resources in an environment wherein… ❖ Work arrives at well-defined but highly variable rates Display ❖ Tasks may exceed their execution time estimates Display Initiation Time (in frame times) » … and still guarantee adherence to deadlines ◆ The problem: Receive frames from the network and ◆ The thesis: deliver to a display application so as to ensure... » Static priority scheduling is the wrong tool for the job » Continuous playout (existing task models are too simplistic) » Minimal playout latency » Rate-based scheduling abstractions can simplify the design and implementation of many real-time systems and ◆ The theory: Multimedia is easy — it’s periodic! improve performance and resource utilization » Apply existing theory of periodic or sporadic tasks 3 4
Display-side Media Processing Display-side Media Processing The practice Managing the Network Interface Acquire Acquire X X Display Display Initiation Time (in frame times) Display Display Initiation Time (in frame times) ◆ Nothing is periodic in a distributed system! ◆ Packets fragmented in the network must be ◆ The effects of distributed systems pathology: reassembled » Variable message transmission times » Messages have deadlines, packets do not » Out-of-order message arrivals » Applications know about messages, operating systems do » Lost & duplicate messages not 5 6 The Case Against Priority Scheduling Rate-Based Computing Example: Signal processing data flow graphs Approaches ◆ Extend the Liu and Layland model of real-time tasks to t hes hol d = 7, allow the expression of real-time rates U consume = 5 » Hierarchical “server-based” scheduling — Create a “server” produce = 3 process that is scheduled as a periodic task and internally Node u has a period of 3 W Node v has a period of 5 schedules the processing of aperiodic events produce = 4 t hes hol d = 4 » Event-based scheduling — Process aperiodic events as if they V consume = 4 were generated by a virtual “well behaved” periodic process ◆ Adapt “fluid-flow” models of resource allocation developed in the networking community for bandwidth u allocation to CPU scheduling v » Provide a “virtual processor” abstraction wherein each task logically executes on a dedicated processor with 1/ƒ( n ) the w capacity of the physical processor 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Time 7 8
An Event-Based Rate Model The RBE Task Model The Rate-Based Execution ( RBE ) model Example: Periodic arrivals, periodic service ◆ Task with rate specification ( x = 1, y = 2, d = 2) ◆ Tasks make progress at the rate of processing x events t i,j + d i if 1 ≤ j ≤ x i every y time units and each event is processed within d D ( i , j ) = time units (in the best case) MAX( t i,j + d i , D ( i , j – x i )+ y i ) if j > x i ◆ For task i with rate specification ( x i , y i , d i ), the j th event » Deadlines separated by at least y = d = 2 time units for task i , arriving at time t i,j , will be processed by time » Deadlines occur at least 2 time units after a job is released t i,j + d i if 1 ≤ j ≤ x i D ( i , j ) = MAX( t i,j + d i , D ( i , j – x i )+ y i ) if j > x i J 1,1 J 1,2 J 1,3 J 1,4 J 1,5 J 1,6 J 1,7 J 1,8 J 1,9 J 1,10 J 1,11 J 1,12 » D ( i , j ) gives the earliest possible deadline for the j th instance 0 2 4 6 8 10 12 14 16 18 20 22 24 26 of task i ( ≥ t i,j + d i ) 9 10 The RBE Task Model The RBE Task Model Example: Periodic arrivals, deadline ≠ period Bursty arrivals ◆ Task with rate specification ( x = 1, y = 2, d = 6) ◆ Task with rate specification ( x = 1, y = 2, d = 6) t i,j + d i if 1 ≤ j ≤ x i » Deadlines separated by at least y = 2 time units and occur at least d = 6 time units after a job is released D ( i , j ) = MAX( t i,j + d i , D ( i , j – x i )+ y i ) if j > x i » Deadlines separated by at least y = 2 time units and occur at least d = 6 time units after a job is released J 1,1 J 1,8 J 1,2 J 1,9 J 1,3 J 1,4 J 1,1 J 1,5 J 1,9 J 1,5 J 1,2 J 1,6 J 1,10 J 1,6 J 1,3 J 1,7 J 1,11 J 1,7 J 1,4 J 1,8 J 1,12 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 11 12
The RBE Task Model The RBE Task Model Bursty arrivals Comparison of rate specifications ◆ Task with rate specification ( x = 3, y = 6, d = 6) J 1,1 » Deadlines separated by at least y = 6 time units and occur J 1,2 J 1,3 Rate specification at least d = 6 time units after a job is released J 1,4 ( x = 1, y = 2, d = 6) J 1,5 J 1,6 J 1,7 J 1,8 J 1,9 J 1,1 J 1,8 0 2 4 6 8 10 12 14 16 18 20 22 24 26 J 1,2 J 1,9 J 1,3 J 1,4 J 1,1 J 1,2 J 1,5 J 1,3 Rate specification J 1,4 J 1,6 J 1,5 ( x = 3, y = 6, d = 6) J 1,6 J 1,7 J 1,7 J 1,8 J 1,9 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 0 2 4 6 8 10 12 14 16 18 20 22 24 26 13 14 The RBE Task Model The RBE Task Model RBE features/properties RBE features/properties ◆ Provides better response Acquire ◆ Provides a more natural time for non-real-time way of modeling activities by Display Receiver’s Display Initiation Time inbound packet integrating Processing Network Display Pipeline Reception processing of application-level fragmented messages buffering with the system run queue Rate specification ( x = 3, y = 6, d = 6) Rate specification ( x = 1, y = 2, d = 6) 0 2 4 6 8 10 12 0 2 4 6 8 10 12 15 16
Fluid Flow Resource Allocation The RBE Task Model Proportional share resource allocation RBE features/properties ◆ Tasks are allocated a share of the processor’s capacity Acquire ◆ Provides isolation from » Task i is assigned a weight w i arrival rates that exceed » Task i ’s share of the CPU at time t is the rate specification Display w i Display Initiation Time » (But does not provide f i ( t ) = Σ j A ( t ) w j isolation from tasks ∋ exceeding their stated execution time) ◆ If tasks’ weights remain constant in [ t 1 , t 2 ] then task i receives S i ( t 1 , t 2 ) = ∫ f i ( t ) dt = ( t 2 – t 1 ) t 2 w i Σ j w j Rate specification t 1 ( x = 3, y = 6, d = 6) units of execution time in [ t 1 , t 2 ] 0 2 4 6 8 10 12 17 18 Proportional Share Resource Allocation Proportional Share Resource Allocation Fluid scheduling example Quantum scheduling example ◆ Weighted round robin scheduling with an infinitesimally ◆ Weighted round robin scheduling with integer quanta small quantum » q = 1 ◆ In [ t 1 , t 2 ] (if total weight doesn’t change) T i receives ◆ The quantum system doesn’t proportionally allocate = ∫ f i ( t ) dt = ( t 2 – t 1 ) t 2 w i the resource over all time intervals S i ( t 1 , t 2 ) = Σ j A ( t ) w j t 1 ∋ Weight Share Weight Share T 1 : 4 0.5 T 1 : 4 0.5 T 2 : 1 0.125 T 2 : 1 0.125 T 3 : 1 0.125 T 3 : 1 0.125 T 4 : 1 0.125 T 4 : 1 0.125 T 5 : 1 0.125 T 5 : 1 0.125 Time Time 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 19 20
Recommend
More recommend