Device Management Flashcards

1
Q

Device Management Objectives

A
  • Abstraction from details of physical devices
  • Uniform naming that doesn’t depend on hardware details
  • Serialization of I/O operations by concurrent applications
  • Protection of standard devices against unauthorized access
  • Buffering, if data from.to a device can’t be stored in the final destination
  • Error handling of device errors
  • Virtualizing physical devices via memory and time multiplexing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

types of I/O devices

A
  1. Block
  2. Character
  3. Network
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Block devices examples & characteristics

A

-disk drives
-commands: read, write, seek
-raw I/O or file-system access
-memory-mapped file access possible

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

Character devices examples & characteristics

A

-keyboards, mice, serial ports
-commands: get, put
-libraries layered on top allow line editing

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

Programmed I/O characteristics (aka?)

A

-polling
-thread is busy waiting for the I/O operation
-kernel thread is polling the state of an I/O device

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

Interrupt-driven I/O characteristics

A

-I/O command is issued
- processor continues executing instructions
-I/O device sends an interrupt when I/O command is done

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

How is data on hard drives addressed?

A

CHS: Data is addressed by specifying its physical Cylinder, Head, and Sector. It is limited to just under 8 gb of data

LBA: Logical Block Addressing is a successor to CHS that allows addressing large hard drives. Using LBA only one is used to address data on the hard disk.

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

What is SMR? Explain.

A

Shingled Magnet Recording: it writes new tracks overlapping with previously written tracks. Consequently, SMR improves data density compared to Conventional Magnetic Recording.
A write to an SMR track destroys data on neighboring tracks. Thus, purely sequential writes are strongly preferred for SMR drives to avoid rewriting neighboring tracks.

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

Why is rewriting data on a flash-based solid-state drive an order of magnitude slower than writing?

A

NAND memory needs to be erased before it can be written again. Rewriting requires reading an entire block, erasing it and writing the modified pages and other pages which haven’t been modified back to the block. The erase cycle is very slow compared to reading.

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

What are spare blocks in SSDs used for?

A

When previously erased blocks (spare blocks) are available, erasure can be performed lazily when the disk is idle. This way, on a rewrite, the block is relocated to a spare block and the old block is marked for later erasure.

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

How does the trim command help with slow rewrites?

A

When a file is deleted, the underlying pages aren’t automatically freed. trim passes this information on the SSD, so that the pages can be cleared in advance for future (re)writes.

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

RAID vs SLED

A

SLED: single large expensive disk - a disk with large capacity, high read/write speeds, low latencies, low fault rates,… => almost impossible

RAID: redundant array of inexpensive disks - multiple drives working together with the same goal

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

Enumerate RAIDs and their characteristics

A

RAID 0: block-level striping, distributes the contents of each file among all drives in the set, failure of any drive causes entire files to be lost, higher throughput

RAID 1: data mirroring, data is written identically to two drives, improved performance, slower write throughput

RAID 2: bit-level striping with Hamming code parity, each sequential bit on a different drive

RAID 3: byte-level striping with dedicated parity, each sequential byte on a different drive

RAID 4: block-level striping with dedicated parity, I/O parallelism, improved performance

RAID 5: block-level striping with distributed parity, parity information Is distributed among the drives, upon failure of a single drive subsequent reads can be calculated from the distributed parity

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

Why does the OS have limited information about the layout of data on hard disks?

A
  • logical block addressing abstracts away from disk layout
  • sector sparing can cause blocks to be far apart on the disk, although their block numbers are close together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why are SDDs much faster than hard disks for random access?

A

Randomly accessing flash chips/packages is faster than mechanically moving around a hard disk arm. With NCQ, requests to data in different flash chips can be handled in parallel, in contrast to a hard disk’s single arm.

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

What is NCQ?

A

Native Command Queueing: We submit multiple requests to the device before receiving a response. The drive can optimize them based on knowledge of its internals.

17
Q
A