track-aligned extents: matching access patterns to disk drive characteristics j. schindler...

20
TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University STILL INCOMPLET E

Upload: ferdinand-johnson

Post on 28-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

TRACK-ALIGNED EXTENTS:MATCHING ACCESS PATTERNS

TO DISK DRIVE CHARACTERISTICS

J. SchindlerJ.-L.GriffinC. R. Lumb

G. R. GangerCarnegie Mellon University

STILL

INCOMPLETE

Page 2: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Key Ideas

• Track-based disk access could improve performance of modern disk drives by up to 50%

• Track boundaries can be detected at a reasonable cost

• This knowledge can be used by existing file systems without creating hardware dependencies

• The technique results significant improvements of application performance

Page 3: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

MOTIVATION

• Modern disk drives virtualize their storage space as a “flat array of fixed-size blocks”– Prevents OS from taking into account actual

characteristics of disk drive• Sole feasible optimization technique is

increasing block size– Introduces several problems– Has limited benefits

Page 4: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Increasing block size

Page 5: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Increasing block sizes (cont’d)

• Achieving good disk efficiency requiresvery large blocks:– Only 50% efficiency for random writes with

256K blocks• Aligning blocks with track boundaries achieves

much higher efficiencies: – Best results obtained when block size is

multiple of track size (264KB in example)

Page 6: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

TRACK-BASED DISK ACCESS

• Cannot keep increasing disk request sizes because large disk requests– Have higher latency– Require more I/O buffer space– Work best when applications access

sequentially very large files– Require collocation of related small files

Page 7: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Disk characteristics

• Head switches occur anytime a single request accesses blocks that span two tracks– Cause a delay of 0.6 to 1ms– Are not likely to diminish in the near future

• Zero-latency access allows disk firmware to read data blocks in the order they can be read rather than in the requested order

Page 8: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Example

• Disk firmware wants to read sector 200-299

• Disk head located before sector 250

• Firmware will read– Fist sectors 250 to 299– Then sectors 200 to 249

Page 9: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

TRACK-AWARE SYSTEM DESIGN

• Locating track boundaries is not easy because– Outer tracks have more sectors than inner tracks– Tracks have spare blocks – Defect handling schemes vary widely among disk

makes and models• Need be performed once

– Defects only appear during first 48 hours of operation

Page 10: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Allocation and access (I)

• To use track boundary information, file system must support variable extents

• Extent-based file systems specify ranges of LBNs allocated to each file (extents)– Should always specify extents that fit track

boundaries

Page 11: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Allocation and access (II)

• Block-based file systems, such as FFS, group LBNs into fixed-size groups of 2n sectors called blocks– Must ensure that blocks will never span track

boundaries– Wastes less than 5% of disk space– This space could still be used for other

purposes

Page 12: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Allocation and access (III)

• Should also– Extend or clip prefetch and write back requests

based on track boundaries– Use disk command queuing to fully take

advantage of zero-latency disks• Current SCSI and IDE/ATA controllers do

not allow out-of-order delivery to or from the host

Page 13: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Prototype implementation

• Prototype includes– Two techniques for detecting track boundaries– A modified version of FreeBSD FFS

Page 14: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Detecting track boundaries (I)

• First technique:– Identifies discontinuities in access efficiency– Could be done by linearly increasing number

of sector in each I/O request– Uses instead binary search algorithm and

tries to predict size of next extent– Still very slow (4 hours for 9GB disk)

Page 15: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Detecting track boundaries (II)

• Second technique:– Specific to SCSI disks– Extract disk information through SCSI

commands– Exploits the regularity of disk geometry– Much faster ( < one minute per disk)– Does not always work when disk mapping

scheme is not knwon

Page 16: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

FreeBSD FFS overview

• Each block has– An lblkno (logical block number) specifying its

offset from the beginning of the file– A blkno (physical block number) , which is an

abstract representation of disk addresses used by the OS

• Each blkno corresponds to a range of contiguous disk sector numbers

Page 17: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Free BSD modifications

• Exclude from all allocation decisions all blocks that span track boundaries– Mark them as used in the free block map

• FFS clustered read-ahead algorithm – Accesses runs of blocks between excluded

blocks with a single request• Must still take care of track boundaries

without excluded blocks

Page 18: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Evaluation

• Using – Two disks supporting zero-latency access– Two disks supporting it

• Also used Disksim simulator to simulate disks

Page 19: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Disk performance

• Measured request head time, that is, amount of time that the head is dedicated to a request– Biggest improvements were for disks

supporting zero-delay access• Efficiency improvements of up to 50%• Also reduced standard-deviation of

response times

Page 20: TRACK-ALIGNED EXTENTS: MATCHING ACCESS PATTERNS TO DISK DRIVE CHARACTERISTICS J. Schindler J.-L.Griffin C. R. Lumb G. R. Ganger Carnegie Mellon University

Other experiments

• With a modified FFS file system– Not that different timings

• With a video server– Track extents resulted in much lower startup

latency at high arrival rates• A log-structured file system