Secondary Storage
Tom Kelliher, CS 318
Apr. 15, 1998
Announcements:
From last time: Paging, segmentation.
Outline:
- Disk terminology.
- Scheduling algorithms.
- Care and feeding of disks.
- Swap.
- Reliability.
Assignment:
Important disk terminology:
- Flying read/write heads.
- Platter(s).
- Stepper, voice coil actuators.
- Cylinder.
- Track.
- Sector. Block. Sector address. 1-D vs. 3-D addressing (cylinder,
track, sector). Smallest unit of access.
- Drive geometry. Logical vs. physical.
- CHS vs. LBA addressing. Limitations.
- Zone recording and other ways in which disk drives lie to the system.
- Example drive documentation:
-
http://phoenix.goucher.edu/~kelliher/cs318/medalist.pdf
--- a modern ATA drive.
-
http://phoenix.goucher.edu/~kelliher/cs318/cheetah.pdf
--- a modern
SCSI drive.
Components of disk access time:
- Seek time: time for read/write heads to move to addressed cylinder.
About 10 ms.
- Rotational latency: time for addressed sector to rotate under
read/write head. Average latency: 0.5 revolution at 3600--10,000 RPM.
- Transfer time: time to read/write sector. Bandwidth. Bottlenecks?
Often, multiple requests will be queued for each disk. In what order
should we service them?
Disk request will include:
- Read/write indication.
- Block number translated to drive coordinates.
- Memory buffer address.
- 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.
Service requests in order they're received.
- Fair.
- Easy to implement.
- Poor performance.
Shortest-seek-time-first scheduling: Service ``nearest'' request.
- Implementation?
- Starvation.
- Variance in turnaround times.
What, no acronym?
Sweep read/write heads from outer cylinder to inner and back out, servicing
requests in both directions.
- No starvation.
- Variance in turnaround times.
- Requests serviced in both directions.
Sweep read/write heads from outer cylinder to inner and back out, servicing
requests in one direction.
- Less variance in turnaround times.
- One ``wasted'' scan.
Similar to SCAN and C-SCAN, slightly smarter.
- FAT at beginning of disk.
- Directories, inodes sprinkled over disk in cylinder groups.
- What's an index block?
- Placement of file data and directory info.
- Formatting: low- and high-level.
Some disks can no longer be low-level formatted.
High-level == logical formatting.
- Partitions: Physical, logical.
- Bad block tables. Remapping:
- SCSI: in hardware.
- IDE/ATA: in software(?).
- Partition size, block numbering and block size. Or, why do I see so
much internal fragmentation?
- Boot blocks:
- Master boot record.
- Partition boot records.
- Swap files vs. partitions.
- Files --- pros: easy to implement, add on-the-fly, dynamic growth;
cons: slower (traverse file system), fragmentation, dynamic growth (suck
up all available space)
- Partitions --- pros: faster, maybe add on-the-fly; cons: another
partition (less flexibility), must re-partition to add more swap space.
- Multiple swap partitions.
- Too much space doesn't hurt. Too little will.
- No file system structure.
- Unix: swap allocated at process creation for text and data. Shard
swap for text.
- Multiple FATs, super blocks.
- Disk mirroring.
- Striping and RAID.
Thomas P. Kelliher
Mon Apr 13 09:56:26 EDT 1998
Tom Kelliher