Docsity

Operating Systems: Lecture 20 - Disk Structure, Addressing, and Scheduling, Study notes of Computer Science

Partial preview of the text

Download Operating Systems: Lecture 20 - Disk Structure, Addressing, and Scheduling and more Study notes Computer Science in PDF only on Docsity!

Operating Systems

CMPSC 473

Storage April 3, 2008 - Lecture 20

Outline

  • Disk structure: physical and logical
  • Disk addressing
  • Disk scheduling
  • Management

CERN Particle Collider

Example of Mass Storage

Application

Past & Present in Storage

1956: IBM 305 RAMAC - 5 MB capacity (50 disks, each 24” in diameter) 2008: Seagate Savvio 15K - 73.4 GB capacity, 2.5” diameter

  • can read/write complete works of Shakespeare 15 times per second

Secondary Storage

  • Generally, magnetic disks provide the bulk of secondary storage in systems - future alternative: solid-state drives? - e.g. MacBook Air - MEMS and NEMS(nanotech) - holographic storage - data read from intersecting laser beams www.inphase-technologies.com

Inside a Hard Disk Aluminum (sometimes glass) platters

Disk Operation

  • Platters start moving from rest ( spinup time)
    • lots of mass to start moving
  • Heads find the right track ( seek time)
    • arm powered by actuator motor, accelerates and coasts, slows down and settles on correct track (servo-guided)
  • Disk rotates until correct sector found ( rotational latency ) - contingent on platter diameter and RPM (Savvio 15K rotates 300 times/second)
  • Have to stop the platters ( spindown time)

Addressing Disks

  • Old days: CHS (cylinder-head-sector)
    • supply physical characteristics of the disk to the operating system
    • it specifies exactly where on the physical disk to read and write data
  • Nowadays: cylinders not uniform
    • can store more data on outer tracks than inner tracks (zoned bit recording) - why? - function of constant angular velocity (CAV) vs constant linear velocity (CLV) found in CD-ROM

Disk Scheduling

  • Why does the OS need to schedule?
    • Improves access time (seek time & rotational latency)
    • even with LBA, assumption is that blocks are written in essentially contiguous order
    • maximizes bandwidth
      • transferred bytes / service + transfer time

Disk Scheduling Algorithms

  • Consider the following request queue
    • min cylinder = 0, max cylinder = 199
      • requests at the following cylinders:
      • 98, 183, 37, 122, 14, 124, 65, 67
      • drive head is at cylinder 53

Shortest Seek Time First

(SSTF)

  • Min. seek time from head position (like SJF)
  • Head movement of 236 cylinders

SCAN (Elevator) Algorithm

  • Arm moves from one end of disk to the other then reverses (like an elevator)
  • Head movement of 208 cylinders

C-LOOK Algorithm

  • Like C-SCAN but only seeks to farthest request in queue
  • Returns to lowest request (not start of disk)

Choosing a Disk Scheduling

Algorithm

  • SSTF: increased performance over FCFS
  • SCAN, C-SCAN: good for heavy loads
    • less chance of starvation
  • C-LOOK: good overall
  • File allocation plays a role
    • contiguous allocation limits head movement
  • Note: only considering seek time
    • rotational latency also important but hard for OS to know (doesn’t have physical drive characteristics) - drive controllers implement some queueing and request coalescing