Lottery and Stride Scheduling Flexible Proportional-Share Resource - - PowerPoint PPT Presentation

lottery and stride scheduling
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Lottery and Stride Scheduling

Flexible Proportional-Share Resource Management Carl A. Waldspurger

Parallel Software Group MIT Laboratory for Computer Science August 25, 1995

slide-2
SLIDE 2

Overview

Context Framework Mechanisms Prototypes Diverse Resources Conclusions

slide-3
SLIDE 3

Problem

Environment

multiplex scarce resources concurrently executing clients service requests of varying importance

Goals

manage computation rates dynamically enable flexible application-level policies promote software engineering principles
slide-4
SLIDE 4

Related Work

Priority-Based Scheduling

  • perating systems
real-time systems

Share-Based Scheduling

fair-share proportional-share microeconomic

Rate-Based Network Flow Control

virtual clock, WFQ AN2 switch
slide-5
SLIDE 5

Contributions

New Framework

simple, powerful abstractions modular resource management

Novel Mechanisms

randomized and deterministic algorithms precise control over service rates

Resource-Specific Techniques

proportional-share control locks, memory, disk I/O
slide-6
SLIDE 6

Resource Management Framework

Simple

direct control over service rates resource rights aggregate and vary smoothly

Modular

powerful abstraction mechanism insulate concurrent modules

Flexible

can express sophisticated policies adapts to dynamic changes general-purpose, scalable
slide-7
SLIDE 7

Framework Abstractions

Tickets

first-class objects encapsulate resource rights proportional throughput inversely proportional response time

Currencies

modular abstraction mechanism name, share, protect sets of tickets flexibly group or isolate sets of clients
slide-8
SLIDE 8

Dynamic Management Techniques

Ticket Transfers

explicit transfer between clients useful when client blocks while waiting example: synchronous IPC

Ticket Inflation and Deflation

clients create and destroy tickets effects locally contained by currencies example: progress-based allocation
slide-9
SLIDE 9

Example 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 in

base units?

100

300 1000 + 1 1 100 100 2000

2333 base units
slide-10
SLIDE 10

Proportional-Share Mechanisms

Randomized

lottery multi-winner lottery

Deterministic

stride hierarchical stride

Evaluation Criteria

throughput accuracy response-time variability algorithmic complexity
slide-11
SLIDE 11

Lottery Scheduling Example

10 2 5 1 2

2 4 6 8 10 12 14 16 18

winner random [0..19] = 13 total = 20

slide-12
SLIDE 12

Lottery Scheduling Analysis

Strengths

simple, stateless algorithm supports dynamic operations randomization prevents cheating

Weaknesses

guarantees are probabilistic poor short-term accuracy: O( p n a) absolute error high response-time variability:
  • = =
p1
  • p
slide-13
SLIDE 13

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

slide-14
SLIDE 14

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 efficiency

Weaknesses

probabilistic guarantees for small clients dynamic operations terminate superquantum
slide-15
SLIDE 15

Stride Scheduling Example

5 10

Time (quanta)

5 10 15 20

Pass Value

3 : 2 : 1 allocation Initialization

stride =

stride1 tickets

pass = stride stride1 = 6

strides: 2, 3, 6

Allocation

choose client C

with minimum pass

C.pass += C.stride
slide-16
SLIDE 16

Dynamic Stride Allocation Change

stride’ stride

now pass pass’ remain remain’ done now

Allocation Change

tickets ! tickets stride 0 =

stride1 tickets

remain 0 = stride

stride remain

pass 0 = now + remain

no updates needed for other clients

slide-17
SLIDE 17

Stride Scheduling Analysis

Strengths

strong deterministic guarantees throughput error independent of n a maximum relative error is one quantum

Weaknesses

  • O(
n c) absolute error poor behavior for skewed ticket allocations
slide-18
SLIDE 18

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 = 180

Allocation

follow child C with

smaller pass value

C.pass += C.stride
slide-19
SLIDE 19

Hierarchical Stride Analysis

Strengths

  • O(lg
n c) absolute error reduces worst-case response-time variability avoids worst-case stride scheduling behavior

Weaknesses

can increase response-time variability actual error can exceed stride scheduling error complex dynamic operations
slide-20
SLIDE 20

Throughput 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 hierarchical
slide-21
SLIDE 21

Response-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 hierarchical
slide-22
SLIDE 22

Prototype Process Schedulers

Lottery Scheduler

modified Mach microkernel DECStation 5000/125 complete framework implementation

Stride Scheduler

modified Linux kernel IBM Thinkpad 350C no ticket transfers or currencies

Low System Overhead

slide-23
SLIDE 23

Relative Rate Accuracy

2 4 6 8 10

Ticket Ratio

5 10 15

Observed Iteration Ratio

Lottery Scheduler

Dhrystone

benchmark

two tasks three 60-second

runs for each ratio

Stride Scheduler

arith benchmark two tasks three 30-second

runs for each ratio

slide-24
SLIDE 24

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
slide-25
SLIDE 25

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

slide-26
SLIDE 26

Modular Load Insulation

100 200 300

Time (sec)

2 4 6 8

Iterations (millions)

A B1 B2

lottery scheduler currencies A, B 2 : 1 funding task A funding 100.A task B1 funding 100.B task B2 joins with funding 100.B

slide-27
SLIDE 27

Managing Diverse Resources

Synchronization Resources

locks, condition variables ticket inheritance, repayment

Space-Shared Resources

inverse lotteries minimum-funding revocation

Disk I/O Bandwidth Multiple Resources

slide-28
SLIDE 28

Conclusions

General Framework

direct application-level control simple, modular, flexible widely applicable

Proportional-Share Algorithms

lottery and stride scheduling efficient O(lg n c) operations techniques for locks, memory, disk
slide-29
SLIDE 29

Future Directions

Multiple Resources

manage all critical resources develop tools for adaptive software microeconomic vs. proportional-share

Human-Computer Interaction

improve application responsiveness GUI elements for resource management