IO Flashcards
what’s a bus?
a communication pathway between components of a computer
what’s a crossbar?
connects any input to any output
what’s a bridge?
connects two different buses
IO APIC is?
IO advanced programmable interrupt controller
the part of the processor that handles interrupts from devices
SRAM
static
very fast, used to cache slower memory
DRAM
dyanmic
capacitor + gate to store a bit
very dense, but slower
VRAM
video
dual ported i.e. can write while another component reads
ways to communicate with a device
mmapped device registers
device memory
direct memory access
mmapped device regs
some ranges of physical addresses correspond to device registers
lw/sw gets status/sends instructions to a device, not RAM
device memory
device has memory and OS can write to the device through the IO bus rather than an address
uses special IO instructions in and out
DMA
place instructions to device in RAM
poke device by writing to its registers
device performs action and generates interrupt when done
disadvantages of polling
busy waiting
xor high latency
receive livelock is
CPU spends all its time handling device interrupts because packets arrive too quickly and the interrupt handler has high priority
what are interrupt driven devices good for?
disk requests
head switch times are comparable to
short seek times
LBA
logical block addressing
disk interface presents the disk as a linear array of blocks
CHS
cylinder, head, sector
zoning
more sectors on larger tracks
track skewing
sector 0 position varies by track to improve sequential access times
sparing
flawed sectors not properly storing data are remapped to locations
seek phases
speedup
coast
slowdown
settle
avg seek
max_seek / 3
FCFS tradeoffs
+ easy impl
+ good fairness
- cannot exploit locality to min seek time
- increases avg latency and decreases throughput
SPTF tradeoffs
+ exploit locality to min seek time
+ higher throughput
- starvation
- hard to know fastest request
idea of aged SPTF
give older requests higher priority
elevator scheduling (SCAN)
sweep across disk, service requests as track is approached
SCAN tradeoffs
+ takes advantage of locality
+ bounded waiting
- middle tracks serviced more often
- could miss locality SPTF exploits
C-SCAN is
only sweep in one direction and return to the beginning again
VSCAN(r)
uses effective positioning time
if request not in same direction of previous seek, Teff = Tpos + r Tmax
penalty for changing directions
special values of VSCAN(r)
r = 0 gives SPTF
r = 1 gives SCAN
r = 0.2 good in practice
interrupt driven devices
device interrupts processor when an event happens
handler asks device what happened (data ready, buffer free, request complete)
limitations of flash memory
limited number of overwrites possible
random writes very expensive
limited durability (charge can wear out over time)
flash translation layer
FTL provides wear leveling so writing to the same logical block doesn’t wear out a physical block
NAND flash
used for storage
high density
faster erase/write times
needs error correction
NOR flash
faster reads in smaller data units
can execute code
much slower erases
NAND flash page
2112 bytes - 2048 data 64 metadata/error correcting code
NAND flash blocks
blocks = 64 (SLC) 128 (MLC) pages
blocks divided into 2-4 planes
NAND flash planes
planes can access their blocks in parallel to overlap latencies
NAND flash read/reuse
can read one page at a time
must erase a whole block before reusing it
SCSI domain consists of
devices and an SDS bus connecting the devices
devices in SCSI are
host adapters (system bus to SCSI bus) and SCSI controllers (bus to device)
device roles in SCSI
initiator, target
traditionally host adapter initiator and controllers targets
SCSI request is
a command from initiator to target
LUN in SCSI
controllers have >= 1 LUN
each LUN maintains a queue of tasks
initiator can link commands, so no intervening tasks i.e. atomic
SCSI exceptions/errors
after an error, stop executing most commands
prevents unwanted commands from executing
simplifies device impl
cost to transfer 1 sector?
max_rot_latency/sectors_per_track