80 likes | 222 Views
Soft Real Time: Proportional Share and Fairness. Fred Kuhns (fredk@cse.wustl.edu, http://www.arl.wustl.edu/~fredk) Applied Research Laboratory Department of Computer Science and Engineering Washington University in St. Louis. Providing GPS Like service. emulates sporadic task (p s , e s )
E N D
Soft Real Time:Proportional Share and Fairness Fred Kuhns (fredk@cse.wustl.edu, http://www.arl.wustl.edu/~fredk) Applied Research Laboratory Department of Computer Science and Engineering Washington University in St. Louis
Providing GPS Like service • emulates sporadic task (ps, es) • Scheduling aperiodic tasks in deadline driven systems • Emulate Generalized Processor Sharing (GPS) Algorithm • provides server an infinitesimally small time slice of length proportional to server size. • Timing isolation CS523 – Operating Systems
Terminology and background • Density of a sporadic job Ji: • ei = maximum execution time; ri = release time; di = deadline, density = ei/(di-ri); active in feasible interval (ri, di] • Sporadic Task Si comprised of a string of jobs Jij with execution times eij, interrelease times of pij and instantaneous utilization of eij/pij when dij = pij. • Instantaneous utilization of a sporadic task • ũi = maxj(eij/pij) • independent, preemptable sporadic jobs are schedulable by EDF if total density <= 1 • if total instantaneous utilization <= 1 and deadline equals period then schedulable by EDF. • if total of periodic tasks utilization and sporadic tasks instantaneous utilization <= 1 then schedulable CS523 – Operating Systems
Constant Utilization Servers • Server emulates a sporadic task. • Defined by size == ũs == instantaneous utilization, • d is always defined • emulates sporadic task with constant ũs • Scheduled with periodic tasks on EDF basis • Consumption rules: • C1: consume when executing • Replenishment rules: • R1: initially es = 0, d = 0 • R2: aperiodic job e arrives to empty queue at time t, if t<d, do nothing, else set d = t + e/ũs, ans set es = e • R3: At deadline d of serverif backlogged, set d = d + e/ũs, es = eelse do nothing CS523 – Operating Systems
Total Bandwidth Servers • Uses background time to improve responsiveness over that of a constant utilization server • Consumption rules: • C1: Consume only when executing. • Replenishment rules: • R1: Initially, es = 0, d = 0 • R2: aperiodic job e arrives to empty queue at time t, set d = max(d, t) + e/ũs and es = e. • R3: when done with current job, remove from queue and if backlogged, set d = d + e/ũs and es = eelse if idle then do nothing. CS523 – Operating Systems
Fairness and Starvation • fair within an interval I if the fraction of time received by each backlogged server is proportional to the its size. • Total bandwidth server is not fair • Consider a system which only consists of n such servers. • let wi(t1,t2) equal the processor time used by server i (i.e. allocated processor time) in interval I (t1, t2) for t2 > t1. • Normalized service = wi(t1,t2)/ũi; fair if the normalized service of all servers differ by no more than a fairness threshold FR>0. CS523 – Operating Systems
Weighted Fair Queuing Servers • Goal is to provide fair access to processor while permitting jobs to use an idle processor • Total bandwidth server is not fair • Same worst case response time as total bandwidth server • Non-preemptive version used for network packet scheduling • Jobs are assigned a finish number that represents the round in which its deadline occurs (think of this as virtual time). CS523 – Operating Systems
Weighted fair queuing: preemptive • FN = system finish number, Ub = backlogged utilization • Scheduling • A server is eligible when it has budget and an assigned finish number • Priority assigned to eligible servers based on finish number: Server with smallest finish time has highest priority • Consumption: • Consume only when running • Initialization • I1: Idle system, set FN=0, Ub=0, t-1 = 0; ei,fni = 0 for all i. • I2: first job arrives to an Idle system for some server FQk set t-1 = t, Ub = uk,budget ek = e and fnk = e/uk • Updating current finish number and replenishment • R1: job arrives at an idle server FQi, then 1: increment system FN: FN += (t-t-1)/Ub 2: set t-1 = t and increment Ub += ui 3: update FQi: ei = e; fni = FN + e/ui and place in ready queue • R2: FQi completes a job, remove it from the queue if still backlogged: ei = e; fni += e/ui else (idle): FN += (t - t-1)/Ub, set t-1 = t; decrement Ub -= ui CS523 – Operating Systems