Secondary Storage

Tom Kelliher, CS 318

Apr. 15, 1998

Announcements:

From last time: Paging, segmentation.

Outline:

  1. Disk terminology.

  2. Scheduling algorithms.

  3. Care and feeding of disks.

  4. Swap.

  5. Reliability.

Assignment:

Disk Structure

Important disk terminology:

  1. Flying read/write heads.

  2. Platter(s).

  3. Stepper, voice coil actuators.

  4. Cylinder.

  5. Track.

  6. Sector. Block. Sector address. 1-D vs. 3-D addressing (cylinder, track, sector). Smallest unit of access.

  7. Drive geometry. Logical vs. physical.

  8. CHS vs. LBA addressing. Limitations.

  9. Zone recording and other ways in which disk drives lie to the system.

  10. Example drive documentation:
    1. http://phoenix.goucher.edu/~kelliher/cs318/medalist.pdf --- a modern ATA drive.

    2. http://phoenix.goucher.edu/~kelliher/cs318/cheetah.pdf --- a modern
      SCSI drive.

Components of disk access time:

  1. Seek time: time for read/write heads to move to addressed cylinder. About 10 ms.

  2. Rotational latency: time for addressed sector to rotate under read/write head. Average latency: 0.5 revolution at 3600--10,000 RPM.

  3. Transfer time: time to read/write sector. Bandwidth. Bottlenecks?

Disk Request Scheduling

Often, multiple requests will be queued for each disk. In what order should we service them?

Disk request will include:

  1. Read/write indication.

  2. Block number translated to drive coordinates.

  3. Memory buffer address.

  4. Transfer byte count.

For each of the following scheduling disciplines, assume requests for the following cylinders have been received: 98, 113, 37, 122, 14, 124, 65, 67

Assume read/write head is at cylinder 53.

Our metric: total head movement (in cylinders).

Assume multiple requests to same cylinder are handled all at once.

FCFS Scheduling

Service requests in order they're received.

  1. Fair.

  2. Easy to implement.

  3. Poor performance.

SSTF Scheduling

Shortest-seek-time-first scheduling: Service ``nearest'' request.

  1. Implementation?

  2. Starvation.

  3. Variance in turnaround times.

SCAN Scheduling

What, no acronym?

Sweep read/write heads from outer cylinder to inner and back out, servicing requests in both directions.

  1. No starvation.

  2. Variance in turnaround times.

  3. Requests serviced in both directions.

C-SCAN Scheduling

Sweep read/write heads from outer cylinder to inner and back out, servicing requests in one direction.

  1. Less variance in turnaround times.

  2. One ``wasted'' scan.

LOOK and C-LOOK Scheduling

Similar to SCAN and C-SCAN, slightly smarter.

Filesystem Design Influence upon Request Scheduling

  1. FAT at beginning of disk.

  2. Directories, inodes sprinkled over disk in cylinder groups.

  3. What's an index block?

  4. Placement of file data and directory info.

Care and Feeding of Disk Drives

  1. Formatting: low- and high-level.

    Some disks can no longer be low-level formatted.

    High-level == logical formatting.

  2. Partitions: Physical, logical.

  3. Bad block tables. Remapping:
    1. SCSI: in hardware.

    2. IDE/ATA: in software(?).

  4. Partition size, block numbering and block size. Or, why do I see so much internal fragmentation?

  5. Boot blocks:
    1. Master boot record.

    2. Partition boot records.

Swap

  1. Swap files vs. partitions.
    1. Files --- pros: easy to implement, add on-the-fly, dynamic growth; cons: slower (traverse file system), fragmentation, dynamic growth (suck up all available space)

    2. Partitions --- pros: faster, maybe add on-the-fly; cons: another partition (less flexibility), must re-partition to add more swap space.

  2. Multiple swap partitions.

  3. Too much space doesn't hurt. Too little will.

  4. No file system structure.

  5. Unix: swap allocated at process creation for text and data. Shard swap for text.

Disk Reliability

  1. Multiple FATs, super blocks.

  2. Disk mirroring.

  3. Striping and RAID.



Thomas P. Kelliher
Mon Apr 13 09:56:26 EDT 1998
Tom Kelliher