chapter 11 - i/o management and disk scheduling Flashcards

1
Q

categories of i/o devices

A

human readable device (printers, screens), machine readable (disk drives, sensors), communications (modems)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

differences among i/o devices

A

Data rate: rate of data transfer.

Application: how the device is being used. Ex. disk drive for file storage or for swap space

Complexity of control: some devices are much more complex than others (disk more complex than printer).

Unit of transfer: one character at a time or blocks.

Data representation: data is represented different ways on different devices.

Error conditions: the kind of errors and their handling can be different among different devices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

techniques for performing i/o

A

Programmed I/O: CPU issues I/O and busy waits for it to complete.

Interrupt-driven I/O: CPU issues I/O and continues, is interrupted when I/O completes.

DMA: Direct memory access. CPU issues I/O and DMA module takes over, freeing the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is DMA?

A

direct memory access

occurs when processor send command to the DMA module. DMA module performs data transfer without processor assistance. when completed, DMA module interrupts the processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what information is in the command send to the DMA module?

A

Whether it wants to read or write
The address of the I/O device
The starting memory address to read or write to
The number of words to read or write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the OS design objectives for I/O?

A

efficiency and generality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the I/O layers?

A

logical layer, device layer, scheduling & control layer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the logical I/O layer?

A

provides simple high-level interface to user with generic commands like open, close, read, write.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the device I/O layer?

A

converts requested operations into appropriate sequences of I/O instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is the scheduling and control I/O layer?

A

low-level layer that interacts directly with the I/O module, including interrupts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is I/O buffering? what problems does it solve?

A

lets the OS read/write data using buffers it owns, and managing the I/O to try to maximize efficiency (for example, by reading ahead).

the problems is solves are:
process can’t swap out and interferes with the OS, I/O is slow compared to the speed of the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

types of I/O devices?

A

block-oriented, stream-oriented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what are block oriented I/O devices?

A

Information is stored in fixed sized blocks.
Transfers are made a block at a time.
Used for disks and tapes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are stream-oriented I/O devices?

A

Transfers information as a stream of bytes (no block structure).
Used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a single buffer (i/o management)?

A

Operating system assigns a buffer in main memory for an I/O request.
Transfers made to buffer.
Buffer copied to user space when needed.
Next unit is read into the buffer (read ahead, in anticipation of next request).

block oriented: holds a block

stream oriented: byte of data or an entire line of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are the advantages of a single buffer (i/o)

A

Allows next unit to be read while previous is processed.
Process can be swapped since I/O is using OS buffer.

17
Q

what is a double buffer? (i/o)

A

use of 2 system buffers instead of 1
A process can transfer data to or from one buffer while the operating system empties or fills the other buffer.

18
Q

what is circular buffering? (i/o)

A

use more than 2 buffers arranged in circular queue

no amount of buffering allows an I/O device to keep up with process requests if average demand is greater than the I/O device can service

19
Q

why do we need disk scheduling?

A

processor and memory speed are much faster than disk devices

20
Q

what are the 4 disk performance parameters?

A

Access time: sum of seek time and rotational delay.

Seek time: time it takes to position the head at the desired track

Rotational delay: time its takes for the beginning of the sector to reach the head

Data transfer time: occurs as the sector moves under the head.

21
Q

why do we need disk scheduling policies?

A

Seek time is the primary reason for differences in performance.
By scheduling the accesses, we can improve performance.
If accesses are made at random (rather than scheduled), the performance will be very poor.
Therefore, we can use a random scheduling policy for comparison against other policies.

22
Q

what are the 6 disk scheduling policies/algorithms?

A

FIFO, shortest service time first, SCAN, C-SCAN, N-step-SCAN, FSCAN

23
Q

What is RAID? Why is it important?

A

Redundant Array of Independent Disks

has 7 levels, 0-6

Since disk devices are slow, one possible way to improve performance is to use several devices in parallel, servicing multiple requests at the same time.
Can also use multiple disk devices to improve reliability

more disk devices = higher risk of disk failure
Combat this with redundancy

24
Q

3 characteristics each RAID level has?

A

Multiple physical drives viewed by the OS as a single drive.
Data distributed across the drives.
Redundancy to ensure recoverability if a drive fails

25
Q

which RAID levels aren’t commercially available?

A

RAID levels 2 and 4

26
Q

RAID level 0

A

Not a true RAID member bc it doesn’t have redundancy

each disk divided into strips
The strips are sequenced across each disk, so strip 0 is on disk 0, strip 1 is on disk 1, etc.
If there are n disks, then the first n strips form the first “stripe”, the second n strips form the second stripe, etc.
So, if a read or write consists of n strips, these can be handled in parallel, one strip per disk.

27
Q

RAID level 1

A

Duplicates all data for redundancy.
Every disk has a mirror disk.
Simple recovery but higher cost (you need double the disks = double the $)

28
Q

RAID level 2

A

Strips very small, may be only a single byte.
All disks participate in each read or write.
Uses parity disks for recovery.
Hamming code can correct single-bit errors or detect double-bit errors.
Only useful if lots of disk errors occur, which is not common today.

29
Q

RAID level 3

A

Like RAID 2 but only uses a single additional parity disk.
Uses parity bit instead of an error-correcting code.

30
Q

RAID level 4

A

Disks operate independently, so separate requests can be processed in parallel.
Strips are blocks.
Parity strip stores parity information for blocks.

31
Q

RAID level 5

A

Like RAID 4 but distributes parity strips across all disks.
Keeps parity disk from being a performance bottleneck.

32
Q

RAID level 6

A

Uses two parity strips on different disks instead of just one.
Requires N+2 disks.
Can recover even if two disks fail.
Three disks must fail to be unavailable.