Вы находитесь на странице: 1из 21

Computer Architecture and Organization

Lecture10: Rotating Disks

Majid Khabbazian mkhabbazian@ualberta.ca


Electrical and Computer Engineering University of Alberta

April 9, 2013

Limitations of Main Memory


Size: Main memory is too small to hold all our data
Volatility: Main memory does not store data when computer is off One Solution:
Using Hard Drives:
Large Cheap Non-volatile

Hard Disk Drive (HDD)


Introduced by IBM in 1956.
By 1960, they became the dominant secondary storage device for general purpose computers. In 2013, SSDs are the primary competing technology for secondary storage

HDDs are expected to remain the dominant medium for secondary storage for the foreseeable future
due to advantages in recording capacity and price per unit of storage

SSDs are replacing rotating hard drives especially in portable electronics


Speed, physical size, and durability are more important considerations than price and capacity.

Disk Geometry
Disks are constructed from platters
Each platter consists of two sides or surfaces
Each side coated with a magnetic recording material

A rotating spindle in the center spins the platter at a fixed rotation rate
Typically between 5400 and 15000 revolutions per minute (RPM)

Disk Geometry
Platter
Thin disks coated with magnetic recording material Placed on a rotating spindle in the center of the platter Spin at 5400 to 15000 RPM Has two surfaces (i.e. both sides store data)

Surface comprises a collection of concentric rings called tracks

Disk Geometry
Track:
Partitioned into a collection of sectors

Sector
Contains an equal number of bits (typically 512 bytes) Separated by gaps where no date is recorded
Gaps store formatting bits that identify sectors

Cylinder
A collection of tracks Located in the same location on each surface # of tracks per cylinder = # of surfaces

Numbering
Surfaces, tracks (cylinders), and sectors are numbered

Location is defined as (surface, cylinder, sector)

Logical Disk Blocks


Problem: Disks have varied and complex geometries Sectors/tracks may fail, todays drives automatically remap bad sectors

Too complicated for OS to keep track


Solution:
HD controller provides a logical block interface Sectors are assigned logical #s 0 b-1 HD controller (on disk) keeps track of mapping to (surface, track, sector)

To perform r/w:
OS specifies block # instead of (surface, track, sector) HD controller maps that to (surface, track, sector) r/w data from/to that sector

Disk Capacity

Example 5 platters 512 bytes per sector

20,000 tracks per surface


Average of 300 sectors per track

Aside: How much is a gigabyte?


Depends on the context!
For capacities of DRAMs and SRAMs:
K=210, M=220, G=230, T=240

For measures related to the capacity of I/O devices such as disks and networks:
K=103, M=106, G=109, T=1012

Fortunately, the relative difference is not much


Example: 220=1,048,576 and 106=1,000,000
Difference is about 5%
9

Disk Operations
Magnetic material on surface stores bits
Written and read by passing over area of bit with a r/w head r/w head attached to actuator arm Actuator arm can position head any where on radial axis of disk

Disk Operations
Disk read and write data in sector-sized blocks
Once head is positioned, rotation of disk will bring desired sector under head Disk spins so fast, head flies 0.1 micron above surface at 80 km/hr (sealed in airtight packages)(dont shake it)

Disk Operations
To perform r/w operation:
Seek: move head to correct cylinder Wait for sector: rotation of disk will bring sector under the head R/W sector:
Read: send bits from head to controller as sector passes head Write: send bits from controller to head as sector passes head

Disk Operations

See it in action

Access Time
How long to read or write a sector?
Queuing delay: If other accesses are pending Seek time: time to move head to correct cylinder
Depends on previous position of head Speed of actuator arm Average seek time: measured by averaging time of several thousand seeks Max seek time can be as high as 20ms

Rotational latency: time to wait before sector passes head


Depends on rotation speed of disk Location of sector at time of operation Worst case: head just missed sector and must wait for complete rotation Average case: worst case divided by 2 Max. rotational latency in seconds (1/RPM) x 60 seconds

Access Time
Transfer time (throughput): amount of time to r/w a sector
Depends on rotation speed of disk & # of sectors per track Approx = (1/RPM) x (1/avg. # sectors per track) x 60 seconds

Estimate the avg. time to access the contents of a disk sector as the sum of the avg. seek time, avg. rotational latency, and avg. transfer time
Example:
Disk 7200 RPM, 9ms average seek time, 400 average # sectors/track Access time ?

Access Time Observations


Seek time and rotation time dominate access time
Access time to read 512-byte sized block:
SRAM = 256 ns DRAM = 4000 ns Disk = 10 ms

Disk access time is roughly 40000X greater than SRAM, and 2500X greater than DRAM

Disk Performance Issues


Manufacturers quote average seek time
Based on all possible seeks Locality and scheduling lead to smaller actual average seek times

Smart disk controllers allocate physical sectors on disk for minimum read times
Present logical sector interface to host

Disk drives include caches


Prefetch sectors in anticipation of access Avoid seek and rotational delay
17

Disk Scheduling
Where is the best place to do the scheduling?
OS or the disk?

Fallacy: Best to let the OS schedule disk accesses


But modern drives deal with logical block addresses
Map to physical track, cylinder, sector locations Also, blocks are cached by the drive

OS is unaware of physical locations


Reordering can reduce performance Depending on placement and caching

Solid State Disks (SSDs)


I/O bus Solid State Disk (SSD)
Requests to read and write logical disk blocks Flash translation layer

Flash memory Block 0


Page 0 Page 1

Page P-1

Block B-1
Page 0 Page 1

Page P-1

Pages: 512KB to 4KB, Blocks: 32 to 128 pages Data read/written in units of pages. Page can be written only after its block has been erased A block wears out after 100,000 repeated writes.
19

SSD Performance Characteristics


Sequential read tput Random read tput Rand read access 250 MB/s 140 MB/s 30 us Sequential write tput Random write tput Random write access 170 MB/s 14 MB/s 300 us

Why are random writes so slow?


Erasing a block is slow (around 1 ms) Write to a page triggers a copy of all useful pages in the block
Find an unused block (new block) and erase it Write the page into the new block Copy other pages from old block to the new block

SSD Tradeoffs vs Rotating Disks


Advantages
No moving parts faster, less power, more rugged

Disadvantages
Have the potential to wear out
Mitigated by wear leveling logic in flash translation layer E.g. Intel X25 guarantees 1 petabyte (1015 bytes) of random writes before they wear out

In 2013, about 10 times more expensive per byte

Applications
MP3 players, smart phones, laptops Beginning to appear in desktops and servers

Вам также может понравиться