Seventh Edition Chapter 7 Device Management Learning Objectives After completing this chapter you should be able to describe Features of dedicated shared and virtual devices Concepts of blocking and buffering and how they improve IO performance ID: 409491
Download Presentation The PPT/PDF document "Understanding Operating Systems" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Understanding Operating SystemsSeventh Edition
Chapter 7Device ManagementSlide2
Learning Objectives
After completing this chapter, you should be able to describe:Features of dedicated, shared, and virtual devicesConcepts of blocking and buffering, and how they improve I/O performanceRoles of seek time, search time, and transfer time in calculating access time
Differences in access times in several types of devices
2
Understanding Operating Systems, 7eSlide3
Learning Objectives (cont'd.)
Strengths and weaknesses of common seek strategies and how they compareLevels of RAID and what sets each apart
Understanding Operating Systems, 7e
3Slide4
Types of Devices
Three categories: dedicated, shared, and virtualDedicated device Assigned to one job at a timeFor entire time that job is active (or until released)
Examples: tape drives, printers, and plotters
Disadvantage
Must be allocated for duration of job’s execution
Inefficient if device is not used 100 percent of time
4
Understanding Operating Systems, 7eSlide5
Types of Devices (cont'd.)
Shared deviceAssigned to several processesExample: direct access storage device (DASD)Processes share DASD simultaneously
Requests interleaved
Device manager supervision
Controls interleaving
Predetermined policies determine conflict resolution
Understanding Operating Systems, 7e
5Slide6
Types of Devices (cont'd.)
Virtual deviceDedicated and shared device combinationDedicated device transformed into shared deviceExample: printer
Converted by spooling program
Spooling: speeds up slow dedicated I/O devices
Universal serial bus (USB) controller
Interface between operating system, device drivers, applications, and devices attached via USB hostAssigns bandwidth to each device: priority-based
High, medium, or low priority
Understanding Operating Systems, 7e
6Slide7
Management of I/O Requests
I/O traffic controllerWatches status of devices, control units, channelsThree main tasksDetermine if path availableIf more than one path available, determine which one to select
If
paths all busy, determine when one is available
Maintains database containing each unit’s status and
connections
Understanding Operating Systems, 7e
7Slide8
Management of I/O Requests (cont'd.)
I/O schedulerSame job as process scheduler (Chapter 4)Allocates devices, control units, and channelsIf requests greater than
available paths
Decides which request to satisfy first:
based on different criteria
In many systems I/O requests not preemptedFor some systems
Allow preemption with I/O request subdivided
Allow preferential treatment for high-priority requests
Understanding Operating Systems, 7e
8Slide9
Management of I/O Requests (cont'd.)
I/O device handlerPerforms actual data transferProcesses device interruptsHandles error conditionsProvides
detailed scheduling algorithms
Device dependent
Each I/O device type has its own device handler algorithm
Understanding Operating Systems, 7e
9Slide10
Understanding Operating Systems, 7e
(figure 7.1)
Each control block contains the information it needs to manage the channels, control units, and devices in the I/O subsystem.
© Cengage Learning 2014
10Slide11
I/O Devices in the Cloud
Local operating system’s role in accessing remote I/O devicesEssentially the same role performed accessing local devicesCloud provides access to many more devices
Understanding Operating Systems, 7e
11Slide12
Sequential Access Storage Media
Magnetic tapeEarly computer systems: routine secondary storage Records stored seriallyRecord length determined by application programRecord identified by position on tape
Record access
Tape rotates passing under read/write head: only when access requested for read or write
Time-consuming process
Understanding Operating Systems, 7e
12Slide13
Sequential Access Storage Media (cont'd.)
Tape density: characters recorded per inchDepends upon storage method (individual or blocked records)
Understanding Operating Systems, 7e
(figure 7.2)
Nine-track magnetic tape with three characters recorded using odd parity. A 1/2-inch wide reel of tape, typically used to back up a mainframe computer, can store thousands of characters, or bytes, per inch.
© Cengage Learning 2014
13Slide14
Sequential Access Storage Media (cont'd.)
Interrecord gap (IRG)½ inch gap inserted between each recordSame size regardless of sizes of records it separates
Blocking: group records into blocks
Transfer rate: (tape density) x (transport speed)
Interblock gap (IBG)
½ inch gap inserted between each blockMore efficient than individual records and IRG
Optimal block size
Entire block fits in buffer
Understanding Operating Systems, 7e
14Slide15
Sequential Access Storage Media (cont'd.)
Understanding Operating Systems, 7e
(figure 7.3)
IRGs in magnetic tape. Each record requires only 1/10 inch of tape. When 10 records are stored individually on magnetic
tape, they are separated by IRGs, which adds up to 4.5 inches of tape. This totals 5.5 inches of tape.
© Cengage Learning 2014
(figure 7.4)
Two blocks of records stored on magnetic tape, each preceded by an IBG of 1/2 inch. Each block holds 10 records, each of which is still 1/10 inch. The block, however, is 1 inch, for a total of 1.5 inches.
© Cengage Learning 2014
15Slide16
Sequential Access Storage Media (cont'd.)
Blocking advantagesFewer I/O operations neededLess wasted tape spaceBlocking disadvantages
Overhead and software routines needed for blocking, deblocking, and record
keeping
Buffer space wasted
When only one logical record
needed
Understanding Operating Systems, 7e
16Slide17
Sequential Access Storage Media (cont'd.)
Access timePoor for routine secondary storage except files with very high (90 to 100 percent) sequential activity
Understanding Operating Systems, 7e
(table 7.1)
Access times for
2400-foot magnetic
tape with
a tape transport
speed
of 200
ips
.
© Cengage Learning 2014
17Slide18
Direct Access Storage Devices
Directly read or write to specific disk areaRandom access storage devicesThree categoriesMagnetic disks
Optical discs
Solid state (flash) memory
Access time variance
Not as wide as magnetic tapeRecord location directly affects access
time
Understanding Operating Systems, 7e
18Slide19
Magnetic Disk Storage
Computer hard drivesSingle platter or stack of magnetic platters
Understanding Operating Systems, 7e
(figure 7.5)
A disk pack is a stack of magnetic platters. The read/write heads move between each pair of surfaces, and all of the heads are moved in unison by the arm.
© Cengage Learning 2014
19Slide20
Magnetic Disk Storage (cont’d.)
Two recording surfaces (top and bottom)Each surface formattedConcentric tracks: numbered from track 0 on outside to highest track number in centerRead/write heads move in unison: virtual cylinder
Accessing a record: system needs three things
Cylinder number
Surface number
Sector number
Understanding Operating Systems, 7e
20Slide21
Access Times
File access time factorsSeek time (slowest)Time to position read/write head on trackDoes not apply to fixed read/write head devices
Search time
Rotational delay
Time to rotate DASD
Rotate until desired record under read/write headTransfer time (fastest)
Time to
transfer
data
Secondary storage to main memory transfer
Understanding Operating Systems, 7e
21Slide22
Fixed-Head Magnetic Drives
Record access requires two itemsTrack number and record numberTotal access time = search time + transfer timeDASDs rotate continuouslyThree basic positions for requested record
In relation to read/write head position
DASD has little access variance
Good candidates: low activity files, random access
Blocking minimizes access time
Understanding Operating Systems, 7e
22Slide23
Understanding Operating Systems, 7e
(figure 7.8)
As a disk rotates, Record 1 may be near the read/write head and ready to be scanned, as seen in (a); in the farthest position just past the head, (c); or somewhere in between, as in the average case, (b).
© Cengage Learning 2014
(table 7.2)
Access times for
a fixed-head
disk drive
at 16.8 ms/revolution.
© Cengage Learning 2014
23Slide24
Movable-Head Magnetic Drives
Access time = seek time + search time + transfer timeSearch time and transfer time calculationSame as fixed-head DASD
Blocking: good way to minimize access time
Understanding Operating Systems, 7e
(table 7.3)
Typical access times for a movable-head drive, such as a typical hard drive.
© Cengage Learning 2014
24Slide25
Device Handler Seek Strategies
Predetermined device handlerDetermines device processing orderGoal: minimize seek time Types
First-come, first-served (FCFS);
shortest seek time first (SSTF)
; SCAN (including LOOK, N-Step SCAN, C-SCAN, and C-LOOK)
Scheduling algorithm goals
Minimize arm movement, mean response time, and variance in response time
25
Understanding Operating Systems, 7eSlide26
Device Handler Seek Strategies (cont'd.)
First-come, first-served (FCFS)On average: does not meet the three seek strategy goals Disadvantage: extreme arm movement
Understanding Operating Systems, 7e
(figure 7.9)
Typical access times for a movable-head drive, such as a typical hard drive.
© Cengage Learning 2014
26Slide27
Device Handler Seek Strategies (cont'd.)
Shortest seek time first (SSTF)Requests with track closest to one being served Minimizes overall seek timePostpones traveling to out of
way
tracks
Understanding Operating Systems, 7e
(figure 7.10)
Using the SSTF algorithm, with all track requests on the wait queue, arm movement is reduced by almost one third while satisfying the same requests shown in Figure 7.9 (using the FCFS algorithm).
© Cengage Learning 2014
27Slide28
Device Handler Seek Strategies (cont'd.)
SCANDirectional bitIndicates if arm moving toward/away from disk centerAlgorithm moves arm methodicallyFrom outer to inner track: services every request in its path
When innermost track reached: reverses direction and moves toward outer tracks
Services every request in its path
Understanding Operating Systems, 7e
28Slide29
Device Handler Seek Strategies (cont'd.)
LOOK (elevator algorithm) Arm does not go to either edgeUnless requests exist
Eliminates indefinite postponement
Understanding Operating Systems, 7e
(figure 7.11)
The LOOK algorithm makes the arm move systematically from the first requested track at one edge of the disk to the last requested track at the other edge. In this example, all track requests are on the wait queue.
© Cengage Learning 2014
29Slide30
Device Handler Seek Strategies (cont'd.)
N-Step SCANHolds all requests until arm starts on way backNew requests grouped together for next sweepC-SCAN (Circular SCAN)
Arm picks up requests on path during inward sweep
Provides more uniform wait time
C-LOOK
Inward sweep stops at last high-numbered track request
No last track access unless required
Understanding Operating Systems, 7e
30Slide31
Device Handler Seek Strategies (cont'd.)
Best strategyFCFS best with light loadsService time unacceptably long under high loadsSSTF best with moderate loads
Localization problem under heavy loads
SCAN best with light to moderate loads
Eliminates indefinite postponement
Throughput and mean service times SSTF similarities
C-SCAN best with moderate to heavy loads
Very small service time variances
Understanding Operating Systems, 7e
31Slide32
Search Strategies: Rotational Ordering
Rotational orderingOptimizes search timesOrders requests once read/write heads positionedRead/write head movement time Hardware
dependent
Reduces time wasted
Due to rotational delay
Request arrangementFirst sector requested on second track: next number higher than one just served
Understanding Operating Systems, 7e
32Slide33
Search Strategies: Rotational Ordering (cont'd.)
Understanding Operating Systems, 7e
(figure 7.12)
Example of a virtual cylinder with five sectors for each of its five tracks.
© Cengage Learning 2014
33Slide34
Understanding Operating Systems, 7e
(table 7.4)
It takes 36 ms to fill the eight requests on the movable-head cylinder shown in Figure 7.12. For this example, seek time is 5 ms/track, search time is 1 ms/sector, and data transfer is 1 ms.
© Cengage Learning 2014
34Slide35
Understanding Operating Systems, 7e
(table 7.5)
It takes 28 ms to fill the same eight requests shown in Table 7.5 after the requests are ordered to minimize search time, reducing it from 13 ms to 5 ms.
© Cengage Learning 2014
35Slide36
Optical Disc Storage
Design featuresSingle spiralling trackSame-sized sectors: from center to disc rimSpins at constant
linear
velocity (CLV
)More sectors and more discdata than magnetic disk
Understanding Operating Systems, 7e
(figure 7.13)
On an optical disc, the sectors (not all sectors are shown here) are of the same size throughout the disc. The disc drive changes speed to compensate, but it spins at a constant linear velocity (CLV).
© Cengage Learning 2014
36Slide37
Optical Disc Storage (cont'd.)
Two important performance measuresSustained data-transfer rateSpeed to read massive data amounts from disc
Measured in megabytes per second (Mbps)
Crucial for applications requiring sequential access
Average access time
Average time to move head to specific disc locationExpressed in milliseconds (ms)
Third feature
Cache size
(hardware)
Buffer to transfer data blocks from disc
Understanding Operating Systems, 7e
37Slide38
CD and DVD Technology
CDData recorded as zeros and onesPits: indentationsLands: flat areasReads with low-power laser
Light strikes land: reflects to photodetector
Light striking a pit: scattered and absorbed
Photodetector converts light intensity into digital signal
Understanding Operating Systems, 7e
38Slide39
CD and DVD Technology (cont'd.)
CD-R (compact disk recordable) technologyRequires expensive disk controllerRecords data using write-once techniqueData cannot be erased or modified
Disk
Contains several layers
Gold reflective layer and dye layer
Records with high-power laserPermanent marks on dye layerCD cannot be erased after data recorded
Data read on standard CD drive (low-power beam)
Understanding Operating Systems, 7e
39Slide40
CD and DVD Technology (cont'd.)
CD-RW and DVD-RW: rewritable discsData written, changed, and erasedUses phase change technologyAmorphous and crystalline phase states
Record data: beam heats up disc
State changes from crystalline to amorphous
Erase data: low-energy beam to heat up pits
Loosens alloy to return to original crystalline state
Understanding Operating Systems, 7e
40Slide41
CD and DVD Technology (cont'd.)
DVDs: compared to CDsSimilar in design, shape, and sizeDiffers in data capacityDual-layer, single-sided DVD holds 13 CDsSingle-layer, single-sided DVD holds 8.6 GB (MPEG video compression)
Differs in laser wavelength
Uses red laser (smaller pits, tighter spiral)
Understanding Operating Systems, 7e
41Slide42
Blu-Ray Disc Technology
Same physical size as DVD/CDSmaller pitsMore tightly wound tracksUse of blue-violet laser allows multiple layersFormats: BD-ROM (read only), BD-R (recordable), and BD-RE (rewritable)
Understanding Operating Systems, 7e
42Slide43
Solid State StorageImplements Fowler-Nordheim tunneling phenomenon
Stores electrons in a floating gate transistorElectrons remain even after power is turned off
Understanding Operating Systems, 7e
43Slide44
Flash Memory Storage
Electrically erasable, programmable, and read-only memory (EEPROM)Nonvolatile and removable Emulates random accessDifference: data stored securely (even if removed)Write data: electric charge sent through floating gate
Erase data: strong electrical field (flash) applied
Understanding Operating Systems, 7e
44Slide45
Solid State Drives (SSDs)
Fast but currently pricey storage devicesTypical device functions in smaller physical space than magnetic drivesWork electronically: no moving partsRequire less power; silent; relatively lightweightDisadvantages
Catastrophic crashes: no warning messages
Data transfer rates: degrade over time
Hybrid drive
Combines SSD and hard drive technology
Understanding Operating Systems, 7e
45Slide46
Components of the I/O Subsystem
I/O channelsProgrammable units Positioned between CPU and control unitSynchronize device speedsCPU (fast) with I/O device (slow)
Manage concurrent processing
CPU and I/O device requests
Allow overlap
CPU and I/O operations
Understanding Operating Systems, 7e
46Slide47
Components of the I/O Subsystem (cont'd.)
I/O channel programSpecifies action performed by devicesControls data transmission between main memory and control unitsI/O control unit: receives and interprets signalDisk controller (disk drive interface)
Links disk drive and system bus
I/O subsystem configuration
Multiple paths increase flexibility and reliability
Understanding Operating Systems, 7e
47Slide48
Components of the I/O Subsystem (cont'd.)
Understanding Operating Systems, 7e
(figure 7.17)
Typical I/O
subsystem configuration.
© Cengage Learning 2014
48Slide49
Components of the I/O Subsystem (cont'd.)
Understanding Operating Systems, 7e
(figure 7.18)
I/O subsystem configuration with multiple paths, which increase both flexibility and reliability. With two additional paths, shown with dashed lines, if Control Unit 2 malfunctions, then Tape 2 can still be accessed via Control Unit 3.
© Cengage Learning 2014
49Slide50
Communication Among Devices
Problems to resolveKnow which components are busy/freeSolved by structuring interaction between unitsAccommodate requests during heavy I/O
traffic
Handled by buffering records and queuing requests
Accommodate speed disparity between CPU and I/O devices
Handled by buffering records and queuing requests
Understanding Operating Systems, 7e
50Slide51
Communication Among Devices (cont'd.)
I/O subsystem units finish independently of othersCPU processes data while I/O performedSuccess requires device completion knowledgeHardware flag tested by CPUChannel status word (CSW) contains flag
Three bits in flag represent I/O system component (channel, control unit, device)
Changes zero to one (free to busy)
Flag tested with
polling and
interrupt
s
Interrupts are more efficient way to test flag
Understanding Operating Systems, 7e
51Slide52
Communication Among Devices (cont'd.)
Direct memory access (DMA)Allows control unit main memory access directlyTransfers data without the intervention of CPU
Used for high-speed devices (disk)
Buffers
Temporary storage areas in main memory, channels, control units
Improves
data movement synchronization
Between relatively slow I/O devices and very fast CPU
Double buffering:
record processing by CPU while another is read or written by channel
Understanding Operating Systems, 7e
52Slide53
Communication Among Devices (cont'd.)
Understanding Operating Systems, 7e
(figure 7.19)
Example of double
buffering: (a) the CPU is reading from Buffer 1 as Buffer 2 is being filled; (b) once Buffer 2 is filled, it can be read quickly by the CPU while Buffer 1 is being filled again.
© Cengage Learning 2014
53Slide54
RAID
Physical disk drive set viewed as single logical unitPreferable over few large-capacity disk drivesImproved I/O performanceImproved data recovery Disk failure event
Introduces redundancy
Helps with hardware failure recovery
Significant factors
in RAID level selectionCost, speed, system’s applications
Increase
s
hardware costs
Understanding Operating Systems, 7e
54Slide55
RAID (cont'd.)
Understanding Operating Systems, 7e
(figure 7.20)
Data being transferred in parallel from a Level 0 RAID configuration to a large-capacity disk. The software in the controller ensures that the strips are stored in correct order.
© Cengage Learning 2014
55Slide56
Understanding Operating Systems, 7e
(table 7.7)
The seven standard levels of RAID provide various degrees of error correction. Cost, speed, and the system’s applications are significant factors to consider when choosing a level.
© Cengage Learning 2014
56Slide57
Level Zero
Uses data striping (not considered true RAID)No parity and error correctionsNo error correction/redundancy/recoveryBenefitsDevices appear as one logical unit
Best for large data quantity: non-critical data
Understanding Operating Systems, 7e
(figure 7.21)
RAID Level 0 with four disks in the array. Strips 1, 2, 3, and 4 make up a stripe. Strips 5, 6, 7, and 8 make up another stripe, and so on.
© Cengage Learning 2014
57Slide58
Level One
Uses data striping (considered true RAID)Mirrored configuration (backup)Duplicate set of all data (expensive)Provides redundancy and improved reliability
Understanding Operating Systems, 7e
(figure 7.22)
RAID Level 1 with three disks in the main array and three corresponding disks in the backup array, the mirrored array.
© Cengage Learning 2014
58Slide59
Level Two
Uses small stripes (considered true RAID)Hamming code: error detection and correctionExpensive and complexSize of strip determines number of array disks
Understanding Operating Systems, 7e
(figure 7.23)
RAID Level 2. Seven disks are needed in the array to store a 4-bit data item, one for each bit and three for the parity bits. Each disk stores either a bit or a parity bit based on the Hamming code used for redundancy.
© Cengage Learning 2014
59Slide60
Level Three
Modification of Level 2Requires one disk for redundancyOne parity bit for each strip
Understanding Operating Systems, 7e
(figure 7.24)
RAID Level 3. A 4-bit data item is stored in the first four disks of the array. The fifth disk is used to store the parity for the stored data item.
© Cengage Learning 2014
60Slide61
Level Four
Same strip scheme as Levels 0 and 1Computes parity for each stripStores parities in corresponding stripHas designated parity disk
Understanding Operating Systems, 7e
(figure 7.25)
RAID Level 4. The array contains four disks: the first three are used to store data strips, and the fourth is used to store the parity of those strips.
© Cengage Learning 2014
61Slide62
Level Five
Modification of Level 4Distributes parity strips across disksAvoids Level 4 bottleneckDisadvantageComplicated to regenerate data from failed device
Understanding Operating Systems, 7e
(figure 7.26)
RAID Level 5 with
four disks
. Notice
how the
parity strips
are distributed among the
disks.
© Cengage Learning 2014
62Slide63
Level Six
Provides extra degree of error protection/correctionTwo different parity calculations (double parity)Same as level four/five and independent algorithmParities stored on separate disk across array
Stored in corresponding data strip
Advantage: data restoration even if two disks fail
Understanding Operating Systems, 7e
(figure 7.27)
RAID Level 6.
Notice how
parity strips
and data
check (DC)
strips are
distributed
across the
disks.
© Cengage Learning 2014
63Slide64
Nested RAID Levels
Combines multiple RAID levels (complex)
Understanding Operating Systems, 7e
(figure 7.28)
A RAID Level 10 system.
© Cengage Learning 2014
64Slide65
Nested RAID Levels (cont'd.)
Understanding Operating Systems, 7e
(table 7.8)
Some common
nested RAID
configurations
, always
indicated with
two numbers
that signify
the combination
of levels.
For example
, neither Level
01 nor
Level 10 is the
same as
Level 1.
© Cengage Learning 2014
65Slide66
ConclusionDevice Manager
Manages every system device effectively as possibleDevices Vary in speed and sharability degreesDirect access and sequential access
Magnetic media: one or many read/write heads
Heads in a fixed position (optimum speed)
Move across surface (optimum storage space)
Optical media: disk speed adjustedData recorded/retrieved correctly
Understanding Operating Systems, 7e
66Slide67
Conclusion (cont'd.)
Flash memory: device manager tracks USB devicesAssures data sent/received correctlyI/O subsystem success dependenceCommunication linking
channels, control units, and devices
Seek strategies: advantages and disadvantages (summarized in Table 7.9)
Understanding Operating Systems, 7e
67Slide68
Understanding Operating Systems, 7e
(table 7.9)
Comparison of hard
disk drive
seek
strategies discussed
in this chapter.
© Cengage Learning 2014
68