Lottery and Stride Scheduling Flexible Proportional-Share Resource - - PowerPoint PPT Presentation
Lottery and Stride Scheduling Flexible Proportional-Share Resource - - PowerPoint PPT Presentation
Lottery and Stride Scheduling Flexible Proportional-Share Resource Management Carl A. Waldspurger Parallel Software Group MIT Laboratory for Computer Science August 25, 1995 Overview Context Framework Mechanisms Prototypes Diverse
Overview
Context Framework Mechanisms Prototypes Diverse Resources Conclusions
Problem
Environment
multiplex scarce resources concurrently executing clients service requests of varying importanceGoals
manage computation rates dynamically enable flexible application-level policies promote software engineering principlesRelated Work
Priority-Based Scheduling
- perating systems
Share-Based Scheduling
fair-share proportional-share microeconomicRate-Based Network Flow Control
virtual clock, WFQ AN2 switchContributions
New Framework
simple, powerful abstractions modular resource managementNovel Mechanisms
randomized and deterministic algorithms precise control over service ratesResource-Specific Techniques
proportional-share control locks, memory, disk I/OResource Management Framework
Simple
direct control over service rates resource rights aggregate and vary smoothlyModular
powerful abstraction mechanism insulate concurrent modulesFlexible
can express sophisticated policies adapts to dynamic changes general-purpose, scalableFramework Abstractions
Tickets
first-class objects encapsulate resource rights proportional throughput inversely proportional response timeCurrencies
modular abstraction mechanism name, share, protect sets of tickets flexibly group or isolate sets of clientsDynamic Management Techniques
Ticket Transfers
explicit transfer between clients useful when client blocks while waiting example: synchronous IPCTicket Inflation and Deflation
clients create and destroy tickets effects locally contained by currencies example: progress-based allocationExample Currency Graph
base
3000 2000 base 1000 base
bob
100
alice
300 100 alice
task2
100 bob
task3
200 alice
task1
1
task3
1
Computing Values
currency:sum value of backing tickets
ticket:compute share of currency value
Example
task2 funding inbase units?
100300 1000 + 1 1 100 100 2000
2333 base unitsProportional-Share Mechanisms
Randomized
lottery multi-winner lotteryDeterministic
stride hierarchical strideEvaluation Criteria
throughput accuracy response-time variability algorithmic complexityLottery Scheduling Example
10 2 5 1 2
2 4 6 8 10 12 14 16 18
winner random [0..19] = 13 total = 20
Lottery Scheduling Analysis
Strengths
simple, stateless algorithm supports dynamic operations randomization prevents cheatingWeaknesses
guarantees are probabilistic poor short-term accuracy: O( p n a) absolute error high response-time variability:- = =
- p
Multi-Winner Lottery Example
10 2 5 1 2
2 4 6 8 10 12 14 16 18
winner #1 winner #2 winner #3 winner #4 random [0..19] = 13 total = 20 #win = 4 total / #win = 5
Multi-Winner Lottery Analysis
Strengths
improves accuracy for large clients guarantees bn w t T c quanta per superquantum bounds worst-case response time improves list-based efficiencyWeaknesses
probabilistic guarantees for small clients dynamic operations terminate superquantumStride Scheduling Example
5 10
Time (quanta)
5 10 15 20
Pass Value
3 : 2 : 1 allocation Initialization
stride =stride1 tickets
pass = stride stride1 = 6strides: 2, 3, 6
Allocation
choose client Cwith minimum pass
C.pass += C.strideDynamic Stride Allocation Change
stride’ stride
now pass pass’ remain remain’ done now
Allocation Change
tickets ! tickets stride 0 =stride1 tickets
remain 0 = stridestride remain
pass 0 = now + remainno updates needed for other clients
Stride Scheduling Analysis
Strengths
strong deterministic guarantees throughput error independent of n a maximum relative error is one quantumWeaknesses
- O(
Hierarchical Stride Example
18 10 20 2 90 90 10 18 54 12 15 45 6 30 30 5 36 36 1 180 180
10 : 2 : 5 : 1 Ratio
tickets stride pass
Node Initialization
stride =stride1 tickets
pass = stride stride1 = 180Allocation
follow child C withsmaller pass value
C.pass += C.strideHierarchical Stride Analysis
Strengths
- O(lg
Weaknesses
can increase response-time variability actual error can exceed stride scheduling error complex dynamic operationsThroughput Accuracy Comparison
Time (quanta) Absolute Error (quanta)
200 400 600 800 1000 5 10
Lottery
200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000 5 10
Multi-Winner
200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000 5 10
Stride
200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000 200 400 600 800 1000
13 Tickets
5 10
Hierarchical
200 400 600 800 1000
1 Ticket
200 400 600 800 1000
7 Tickets
200 400 600 800 1000
3 Tickets
20 40 1 2 20 40 1 2 20 40 1 2 20 40 1 2 20 40 1 2 20 40 1 2 20 40 1 2 20 40 1 2
Static Allocation 13 : 7 : 3 : 1 Ratio Mechanisms
lottery multi-winner (2,4,8) stride hierarchicalResponse-Time Comparison
Response Time (quanta) Frequency (log scale)
10 20 30 40 50 1 10 100 1000 10000 100000 1000000
Lottery
10 20 30 40 50 10 20 30 40 50 10 20 30 40 50 10 20 30 40 50 1 10 100 1000 10000 100000 1000000
Multi-Winner
10 20 30 40 50 10 20 30 40 50 10 20 30 40 50 10 20 30 40 50 1 10 100 1000 10000 100000 1000000
Stride
10 20 30 40 50 10 20 30 40 50 10 20 30 40 50 10 20 30 40 50
13 Tickets
1 10 100 1000 10000 100000 1000000
Hierarchical
10 20 30 40 50
7 Tickets
10 20 30 40 50
3 Tickets
10 20 30 40 50
1 Ticket
Static Allocation 13 : 7 : 3 : 1 Ratio Mechanisms
lottery multi-winner (4) stride hierarchicalPrototype Process Schedulers
Lottery Scheduler
modified Mach microkernel DECStation 5000/125 complete framework implementationStride Scheduler
modified Linux kernel IBM Thinkpad 350C no ticket transfers or currenciesLow System Overhead
Relative Rate Accuracy
2 4 6 8 10
Ticket Ratio
5 10 15
Observed Iteration Ratio
Lottery Scheduler
Dhrystonebenchmark
two tasks three 60-secondruns for each ratio
Stride Scheduler
arith benchmark two tasks three 30-secondruns for each ratio
Dynamic Ticket Deflation
500 1000
Time (sec)
20 40 60 80 100
Cumulative Trials (thousands)
stride scheduler Monte-Carlo simulations many trials for accurate results three tasks funding based
- n relative error
Dynamic Ticket Transfers
200 400 600 800
Time (sec)
10 20 30 40
Queries Processed
lottery scheduler query processing multithreaded “database” server three clients 8 : 3 : 1 allocation
Modular Load Insulation
100 200 300
Time (sec)
2 4 6 8
Iterations (millions)
A B1 B2