200 likes | 344 Views
Surplus Fair Scheduling: A Proportional-Share Scheduling Algorithm for Symmetric Multiprocessors. Abhishek Chandra Micah Adler Pawan Goyal † Prashant Shenoy UMASS Amherst and † Ensim Corporation http://lass.cs.umass.edu/software/gms. Motivation. Server. Web. End-stations. Network.
E N D
Surplus Fair Scheduling:A Proportional-Share Scheduling Algorithm for Symmetric Multiprocessors Abhishek Chandra Micah Adler Pawan Goyal † Prashant Shenoy UMASS Amherst and †Ensim Corporation http://lass.cs.umass.edu/software/gms
Motivation Server Web End-stations Network Streaming E-commerce • Diverse web and multimedia applications popular • HTTP, Streaming, e-commerce, games, etc. • Applications hosted on large servers (typically multiprocessors) • Key Challenge: Design OS mechanisms for Resource Management
Requirements for OS Resource Management • Fair, Proportionate Allocation • Eg: 20% for http, 30% for streaming, etc. • Application Isolation • Misbehaving/overloaded applications should not affect other applications • Efficiency • OS mechanisms should have low overheads Focus: Achieving these objectives for CPU scheduling on multiprocessor machines
Outline • Motivation • Proportional-Share Scheduling • Weight Readjustment • Surplus Fair Scheduling • Experimental Evaluation • Concluding Remarks
Associate a weight with each application and allocate CPU bandwidth proportional to weight Existing Algorithms Ideal algorithm: Generalized Processor Sharing E.g.: WFQ, SFQ, SMART, BVT, etc. Question: Are the existing algorithms adequate for multiprocessor systems? Proportional-Share Scheduling Wt=2 Wt=1 Applications 2/3 1/3 CPU bandwidth
Starvation Problem • SFQ : Start tag of a thread ( Service / weight ) • Schedules the thread with minimum start tag . . . S1=0 S1=10 S1=1 . . . S1=11 CPU 1 A (Wt=100) S2=0 S2=100 . . . S2=1000 B (Wt=1) CPU 2 B starves C (Wt=1) . . . CPU 2 S3=10 S3=110 0 100 1000 1100 Time C arrives
Weight Readjustment • Reason for starvation: • Infeasible Weight Assignment (eg: 1:100 for 2 CPUs) • Accounting is different from actual allocation • Observation: • A thread can’t consume more than 1 CPU bandwidth • A thread can be assigned at most (1/p) of total CPU bandwidth • Feasibility Constraint:
Weight Readjustment (contd.) • Goal: Convert given weights to feasible weights • Efficient: Algorithm is O(p) • Can be combined with existing algorithms Decreasing Order of weights . . . . . . CPU p CPU 1 CPU 2 CPU 3
Effect of Readjustment SFQ with Readjustment SFQ without Readjustment 30 25 A (wt=10) A (wt=10) 20 B (wt=1) 15 Number of iterations (105) B (wt=1) 10 C (wt=1) 5 C (wt=1) 0 0 10 20 30 40 50 0 10 20 30 40 50 Time (s) Time (s) • Weight Readjustment gets rid of starvation problem
SFQ J1, wt=20 J2-J21, wt=1x20 J_short, wt=5 0 5 10 15 20 25 30 35 40 Time (s) Short Jobs Problem • Frequent arrivals and departures of short jobs Ideal 20 J1, wt=20 J2-J21, wt=1x20 15 J_short, wt=5 Number of iterations (105) 10 5 0 0 5 10 15 20 25 30 35 40 Time (s) SFQ does unfair allocation!
Surplus Fair Scheduling Surplus = ServiceActual- ServiceIdeal • Scheduler picks the threads with least surplus values • Lagging threads get closer to their due • Threads that are ahead are restrained Service received by thread i Actual Ideal Surplus t Time
Surplus Fair Scheduling (contd.) • Start tag (Si) : Weighted Service of thread i Si = Servicei / wi • Virtual time (v) : Minimum start tag of all runnable threads • Surplus (α i ) : α i =Servicei- Servicelagging = wi Si - wi v • Scheduler selects threads in increasing order of surplus
Surplus Fair Sched with Short Jobs Ideal Surplus Fair Sched • Surplus Fair Scheduling does proportionate allocation 20 J1, wt=20 J1, wt=20 J2-J21, wt=1x20 J2-J21, wt=1x20 15 J_short, wt=5 J_short, wt=5 Number of iterations (105) 10 5 0 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 Time (s) Time (s)
Outline • Motivation • Proportional-Share Scheduling • Weight Readjustment • Surplus Fair Scheduling • Experimental Evaluation • Concluding Remarks
Requirements for OS Resource Management • Fair, Proportionate Allocation • Eg: 20% for web, 30% for streaming, etc. • Application Isolation • Misbehaving/overloaded applications should not affect other applications • Efficiency • OS mechanisms should have low overheads
Proportionate Allocation Processor Shares received by two web servers 7 6 5 Processor Allocation 4 (Normalized) 3 2 1 0 1:1 1:2 1:4 1:7 Weight Assignment
Application Isolation MPEG decoder with background compilations 50 Surplus Fair 40 Time-sharing Frame Rate (frames/sec) 30 20 10 0 0 2 4 6 8 10 Number of background compilations
Scheduling Overhead 10 • Context-switch time(~10μ s) vs. Quantum size (~100ms) Surplus Fair Time-sharing 8 6 Context switch time (microsec) 4 2 0 0 10 20 30 40 50 Number of processes
Related Work • CPU Reservations [Jones99] • Uniprocessor proportional-share: • Hierarchical Scheduling [Goyal96] • BVT [Duda99], SMART [Nieh97] • Lottery Scheduling [Waldspurger94]
Summary • Existing proportional-share algorithms inadequate for multiprocessors • Readjustment Algorithm can reduce unfairness • Surplus Fair Scheduling practical for multiprocessors • Achieves proportional fairness, isolation • Has low overhead • Heuristics for incorporating processor affinity • Source code available at: http://lass.cs.umass.edu/software/gms