Sei sulla pagina 1di 20

Scheduling Algorithms in

Modern Disk Drives


B. Worthington,
G. Ganger,
Y. Patt
Presented by: Chiu Tan

Introduction

Why study scheduling algorithms?

Latency gap between disk and memory is


high.

Good algorithms can narrow this gap.


Disk traffic is bursty, resulting in long queues
of requests. Algorithms can reschedule
requests with respect to disk state to improve
performance.

Outline
Disk basics
Disk Evaluation
Common Algorithms
Simulation Issues
Findings
Conclusion

Disk Basics
Sector (512
bytes + error
correction)

Track (One of
many on a
surface)

Cylinder(Set
of tracks, one
from each
surface)

Disk Basics (II)

How does a disk service a request?

Read/Write performed by a disk arm.

Disk arm has to first find the correct cylinder. This is


known as the seek time.

The disk is spinning. The arm waits until the correct


sector reaches the read/write head of the disk arm.
This is the rotational latency.
Generally, multiple surfaces, but only 1 read/wrote
head is active.

Disk Evaluation
Disk performance primarily measured
using access time.
Access time comprises of seek time and
rotational latency.
Seek time: Time needed to move disk
head to correct cylinder.
Rotational latency: Time needed for disk
to rotate to correct sector.

Common Algorithms
To improve response time, we can reduce
seek time or reduce rotational latency.
Simplest algorithm: FCFS
Seek Time: SSTF. SCAN, LOOK, CLOOK
Seek + Rotational Latency: SPTF
To illustrate:
5,9,18,3,12,1,13,6,7

FCFS: First come first serve


5, 9, 18, 3, 12, 1, 13, 6, 7
20
18
16
14
12
10
8
6
4
2
0
Start

T1

T2

T3

T4

T5

T6

T7

Total: 63

T8

SSTF: Shortest Seek Time


5, 9, 18, 3, 12, 1, 13, 6, 7

ST

T8

T7

T6

T5

T4

T3

T2

T1

20
18
16
14
12
10
8
6
4
2
0

Total: 30

SCAN
5, 9, 18, 3, 12, 1, 13, 6, 7

T9

T8

T7

T6

T5

T4

T3

T2

T1

ST

20
18
16
14
12
10
8
6
4
2
0

Total: 23

LOOK
5, 9, 18, 3, 12, 1, 13, 6, 7

T8

T7

T6

T5

T4

T3

T2

T1

ST

20
18
16
14
12
10
8
6
4
2
0

Total: 21

CLOOK
5, 9, 18, 3, 12, 1, 13, 6, 7

T8

T7

T6

T5

T4

T3

T2

T1

ST

20
18
16
14
12
10
8
6
4
2
0

Total: 33

SPTF: Shortest Positioning

Reducing seek delay needs only relative


seek distances. Easy to estimate.

SPTF is like SSTF, but need to minimize


seek time and rotational latency.

Need actual LBN-to-PBN number,


accurate position of read/write head.

Simulation Issues
Synthetic workload and generated traces
used.
Synthetic workloads are easier to
generate, but unrealistic.
Traces are more realistic, but adjustments
needed.

Different storage capacity.


Different service rates.

Simulation Issues (II)


2 metrics are used: average response
time and squared coefficient of variance
A balance between the two is most
desirable. Faster performance with lesser
starvation.

Findings: Scheduling via LBN


For synthetic workloads, CLOOK average
response time is 5% worst than LOOK,
SSTF, VSCAN.
But CLOOK outperformed the rest in
terms of starvation resistance.
For traces, CLOOK on average
outperforms the rest, and on starvation
resistance as well.

Insights: Scheduling via LBN


Why the difference between the two?
Synthetic workloads are random, traces
are not.
Random read/writes fail to take
advantage of prefetching cache.
Algorithms that preserve read
sequentiality can take advantage of
perfetching cache to perform better!

Findings: via Full Knowledge

With full knowledge, SPTF considered. Aging


component is added to prevent starvation.

For synthetic workloads, all SPTFs perform


better than CLOOK. Appropriate aging results in
SPFT with CLOOK starvation performance.

For traces, clear wins for SPTFs over CLOOK


for some traces, ambiguous for others.

Insights: via Full Knowledge


SPTF-based algorithms perform well
compared to CLOOK, but clearer wins
occur when on-board cache is exploited!
Assign positioning time to zero if found
inside cache. ASPCTF and SPCTF.
Good choice of aging weights have
potential to have superior performance
and starvation resistance.

Conclusion

CLOOK performs best under real world


situations under limited knowledge.
SPTF-based algorithms result in better
performance, but results not that much better
than CLOOK.
Careful aging and exploitation of cache needed
for superior performance.
Algorithms have to exploit perfetching cache to
improve performance regardless.

Potrebbero piacerti anche