Computer Architecture and Organization: Lecture10: Rotating Disks
Computer Architecture and Organization: Lecture10: Rotating Disks
Computer Architecture and Organization: Lecture10: Rotating Disks
April 9, 2013
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
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)
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
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
For measures related to the capacity of I/O devices such as disks and networks:
K=103, M=106, G=109, T=1012
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
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 ?
Disk access time is roughly 40000X greater than SRAM, and 2500X greater than DRAM
Smart disk controllers allocate physical sectors on disk for minimum read times
Present logical sector interface to host
Disk Scheduling
Where is the best place to do the scheduling?
OS or the disk?
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
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
Applications
MP3 players, smart phones, laptops Beginning to appear in desktops and servers