Title: Surplus Fair Scheduling: A Proportional-Share Scheduling Algorithm for Symmetric Multiprocessors
1Surplus Fair SchedulingA 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
2Motivation
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
3Requirements 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
4Outline
- Motivation
- Proportional-Share Scheduling
- Weight Readjustment
- Surplus Fair Scheduling
- Experimental Evaluation
- Concluding Remarks
5Proportional-Share Scheduling
Wt2
Wt1
Applications
2/3
1/3
CPU bandwidth
- 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?
6Starvation Problem
- SFQ Start tag of a thread ( Service / weight )
- Schedules the thread with minimum start tag
. . .
S110
S10
S111
S11
. . .
CPU 1
A (Wt100)
S20
S2100
S21000
. . .
B (Wt1)
CPU 2
B starves
C (Wt1)
. . .
S310
S3110
CPU 2
0
100
1000
1100
Time
C arrives
7Weight Readjustment
- Reason for starvation
- Infeasible Weight Assignment (eg 1100 for 2
CPUs) - Accounting is different from actual allocation
- Observation
- A thread cant consume more than 1 CPU bandwidth
- A thread can be assigned at most (1/p) of total
CPU bandwidth - Feasibility Constraint
8Weight Readjustment (contd.)
- Goal Convert given weights to feasible weights
Decreasing Order of weights
. . .
. . .
CPU p
CPU 1
CPU 2
CPU 3
- Efficient Algorithm is O(p)
- Can be combined with existing algorithms
9Effect of Readjustment
SFQ with Readjustment
SFQ without Readjustment
30
25
A (wt10)
A (wt10)
20
B (wt1)
15
Number of iterations (105)
B (wt1)
10
C (wt1)
5
C (wt1)
0
0
10
20
30
40
50
0
10
20
30
40
50
Time (s)
Time (s)
- Weight Readjustment gets rid of starvation problem
10Short Jobs Problem
- Frequent arrivals and departures of short jobs
Ideal
20
J1, wt20
J2-J21, wt1x20
15
J_short, wt5
Number of iterations (105)
10
5
0
0
5
10
15
20
25
30
35
40
Time (s)
SFQ does unfair allocation!
11Surplus Fair Scheduling
Surplus ServiceActual - ServiceIdeal
Service received by thread i
Actual
Ideal
Surplus
t
Time
- Scheduler picks the threads with least surplus
values - Lagging threads get closer to their due
- Threads that are ahead are restrained
12Surplus 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 (a i ) a i Servicei -
Servicelagging - wi Si - wi v
- Scheduler selects threads in increasing order of
surplus -
13Surplus Fair Sched with Short Jobs
Ideal
Surplus Fair Sched
20
J1, wt20
J1, wt20
J2-J21, wt1x20
J2-J21, wt1x20
15
J_short, wt5
J_short, wt5
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)
- Surplus Fair Scheduling does proportionate
allocation
14Outline
- Motivation
- Proportional-Share Scheduling
- Weight Readjustment
- Surplus Fair Scheduling
- Experimental Evaluation
- Concluding Remarks
15Requirements 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
16Proportionate Allocation
Processor Shares received by two web servers
7
6
5
Processor Allocation
4
(Normalized)
3
2
1
0
11
12
14
17
Weight Assignment
17Application 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
18Scheduling Overhead
10
Surplus Fair
Time-sharing
8
6
Context switch time (microsec)
4
2
0
0
10
20
30
40
50
Number of processes
- Context-switch time(10µ s) vs. Quantum size
(100ms)
19Related Work
- CPU Reservations Jones99
- Uniprocessor proportional-share
- Hierarchical Scheduling Goyal96
- BVT Duda99, SMART Nieh97
- Lottery Scheduling Waldspurger94
20Summary
- 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