Surplus Fair Scheduling Ricardo A. Baratto COMS E6118 – Spring 2004
Proportional-Share CPU Scheduling for Symmetric Multiprocessors
What? Why? ● Fair resource allocation Proportional to application's share ● WFQ [Demers et al.], [Parekh et al.], Stride [Waldspurger et al.] ● SFQ [Goyal et al.] ● SMART [Nieh et al.]
The Problem ● Unfeasible Weight Assignment : Starvation Upper Bound on Assignment ● Frequent Arrival – Departures: Unfairness Burst Behavior
Surplus Fair Scheduling 1.Weight Readjustment 2.Generalized Multiprocessor Sharing (Surplus Approximation)
Weight Readjustment ● Readjust threads violating feasibility constraint: ● Optimal: Number of threads Weight change ● Efficient O(p)
GMS and Surplus Approximation ● Generalization of GPS [Parekh et al.] ● φ i : Readjusted weight ● A i (t 1, t 2 ): CPU service received ● S i : Weighted CPU service = S i + q/φ i ● α i = A i (0, t) - A i GMS (0, t) ≈ (φ i. S i ) - (φ i. v)
SFS Algorithm i.update F i and compute S i ii.compute v: min(S i ) iii.compute α i iv.schedule t i with min(α i ) v.If {t} changes: readjust weights
Implementation and Complexity ● Three ordered queues: – w: Weight readjustment – S: Virtual time – α : Next to schedule ● Add thread: Insert + Readjust = O(t+p) ● Delete thread: Delete + Readjust = O(p) ● Schedule: Update surplus + Sort = O(t log t) [~ every p schedules]
Evaluation: Weight Readjustment
Evaluation: Short Jobs
Evaluation: Application Isolation