Top Banner
04/18/2007 CSCI 315 Operating Systems Design 1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts with Java, by Silberschatz, Galvin, and Gagne (2007). Many, if not all, of the illustrations contained in this presentation come from this source.
14

04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 1

Mass Storage Structure

Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts with Java, by Silberschatz, Galvin, and Gagne (2007). Many, if not all, of the illustrations contained in this presentation come from this source.

Page 2: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 2

Output without Spoolingprinter

process A

process B

process C

A textA textA textB textA textA textC textA textA textA text

(A text, time=0), (A text, time=1),(A text, time=2), (A text, time=4),(A text, time=5), (A text, time=7),(A text, time=8), (A text, time=9)

(B text, time=3)

(C text, time=6)

Page 3: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 3

Output with Spooling

printerprocess A

process B

process C

A textA textA text

B text

A textA text

C text

A textA textA text

(A text, time=0), (A text, time=1),(A text, time=2), (A text, time=4),(A text, time=5), (A text, time=7),(A text, time=8), (A text, time=9)

(B text, time=3)

(C text, time=6)

Spooler

Page 4: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 4

Error Handling

• OS can recover from disk read, device unavailable, transient write failures.

• Most return an error number or code when I/O request fails .

• System error logs hold problem reports.

Page 5: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 5

I/O Requests to Hardware Operations

• Consider reading a file from disk for a process:– Determine device holding file. – Translate name to device representation.– Physically read data from disk into buffer.– Make data available to requesting process.– Return control to process.

Page 6: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 6

Life Cycle of An I/O Request

Page 7: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 7

Performance

I/O a major factor in system performance:

– Demands CPU to execute device driver, kernel I/O code.

– Context switches due to interrupts.– Data copying.– Network traffic especially stressful.

Page 8: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 8

Intercomputer Communications

Page 9: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 9

Improving Performance

• Reduce number of context switches.

• Reduce data copying.

• Reduce interrupts by using large transfers, smart controllers, polling.

• Use DMA.

• Balance CPU, memory, bus, and I/O performance for highest throughput.

Page 10: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 10

Device-Functionality Progression

Page 11: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 11

Disk Structure

sector

track

read/write head

arm

direction of rotation

direction of movement

Points to consider:

Sector sizes (number of bits per sector) should be fixed.

The density of the magnetic material is constant on the surface of the disk.

Size of the sector gets smaller as the radius of the track gets smaller.

The disk rotates at a constant speed. To find a block, the head is moved to the appropriate track, and then the correct sector is found as the disk rotates. Organization of a disk surface

Page 12: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 12

Disk Structure

sector

track

read/write head

arm

direction of rotation

direction of movement

The disk rotation is given in rotations per minute (RPM).

The time to find a track is proportional to the distance the head must travel.

The average time to find a sector within a track is roughly half the time for a full rotation.

Question: If the time to move from track i to track (i+1) is given by , assuming that the disk head is at track 0 (all the way out), could you calculate the time to get to sector 4 in track 5?

Organization of a disk surface

Page 13: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 13

Disk Structure

direction of movement

direction of rotation

Multi-surface disk

arm

read/write headscylinder

A cylinder is the collection of all the same tracks across all the multiple disk surfaces.

There is a time associated with turning heads on and off so that a different surface can be accessed. We call this overhead the head-switching time.

The time to move the arm to read another cylinder is due to the mechanics of the arm. It is certainly much large than the head-switching time, which is due to electronics only.

Question: How should one organize data across multiple surfaces to minimize access overhead?

Page 14: 04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.

04/18/2007 CSCI 315 Operating Systems Design 14

Disk Scheduling