Docsity

I/O Management in Operating Systems: Disk Scheduling, Buffering, and RAID, Slides of Computer Science

Toggle sidebar
bg1
Operating Systems
Lecture 25:
I/O Management
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

Partial preview of the text

Download I/O Management in Operating Systems: Disk Scheduling, Buffering, and RAID and more Slides Computer Science in PDF only on Docsity!

Operating Systems

Lecture 25:

I/O Management

1

Roadmap

  • I/O Devices - 11.
  • Organization of the I/O Function
  • Operating System Design Issues
  • I/O Buffering
  • Disk Scheduling
  • Raid
  • Disk Cache

2

A Typical Hardware System

main memory

I/O

bridge

bus interface

ALU

register file

CPU chip

system bus memory bus

disk controller

graphics adapter

USB

controller

mouse keyboard monitor disk

I/O bus (^) Expansion slots for other devices such as network adapters.

4

Reading a Disk Sector: Step 1

main memory

ALU

register file

CPU chip

disk controller

graphics adapter

USB

controller

mouse keyboard monitor disk

I/O bus

bus interface

CPU initiates a disk read by writing a

command, logical block number, and

destination memory address to a port

(address) associated with disk controller.

5

Reading a Disk Sector: Step 3

main memory

ALU

register file

CPU chip

disk controller

graphics adapter

USB

controller

mouse keyboard monitor disk

I/O bus

bus interface

When the DMA transfer completes, the

disk controller notifies the CPU with an

interrupt (i.e., asserts a special “interrupt”

pin on the CPU)

7

Disk Geometry

  • Disks consist of platters, each with two surfaces.
  • Each surface consists of concentric rings called tracks.
  • Each track consists of sectors separated by gaps.

spindle

surface

tracks

track k

sectors

gaps

8

Disk Operation (Single-Platter View)

The disk surface spins at a fixed rotational rate

spindle

By moving radially, the arm can position the read/write head over any track.

The read/write head is attached to the end of the arm and flies over the disk surface on a thin cushion of air. spindle spindle

spindle

spindle

10

Disk Operation (Multi-Platter View)

arm

read/write heads move in unison from cylinder to cylinder

spindle

11

Disk Access Time

spindle

spindle spindle spindle

spindle

  • Average time to access some target sector

approximated by :

  • Taccess = Tavg seek + Tavg rotation + Tavg transfer
  • Seek time (Tavg seek)
  • Time to position heads over cylinder containing target sector
  • Typical Tavg seek =4 ms
  • Rotational latency (Tavg rotation)
  • Time waiting for first bit of target sector to pass under r/w head
  • Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min
  • Transfer time (Tavg transfer)
  • Time to read the bits in the target sector
  • Tavg transfer = (bytes transferred) x 1/(byte on track) x 1/RPM x 60 secs /1 min (^) Docsity.com^13

Work in Group

  • Given:
    • Rotational rate = 7,200 RPM
    • Average seek time = 4 ms
    • Avg # sectors/track = 400
  • Derive the average time to access some target sector

spindle

spindle spindle spindle

spindle

14

Disk Scheduling

Policies

  • Access time dominated by seek time and rotational latency
    • If sector access requests involves selection of tracks at random, the performance of the disk is is poor!!!
  • To compare various disk scheduling policies, consider a disk

head is initially located at track 100.

  • Assume a disk with 200 tracks and that the disk request

queue has random requests in it.

  • The requested tracks, in the order received by the disk

scheduler, are

  • 55, 58, 39, 18, 90, 160, 150, 38, 184.

16

First-in, first-out (FIFO)

  • Process request sequentially
  • Fair to all processes
  • Approaches random scheduling in

performance if there are many processes

17

SCAN

  • Arm moves in one direction only, satisfying all

outstanding requests until it reaches the last

track in that direction then the direction is

reversed

19

Comparison of

Disk Scheduling Algorithms

20