Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Overview
I/O Hardware
STREAMS
Performance
13.2
Objectives
13.3
Overview
Performance management
13.4
I/O Hardware
Storage
Transmission
Human-interface
Sometimes integrated
Some talk to per-device controller with bus controller, microcode, memory, etc
13.5
13.6
Devices usually have registers where device driver places commands, addresses, and data to write, or read data
from registers after command execution
Memory-mapped I/O
13.7
13.8
Polling
2.
Host sets read or write bit and if write copies data into data-out register
3.
4.
5.
Controller clears busy bit, error bit, command-ready bit when transfer done
13.9
Interrupts
Based on priority
Some nonmaskable
13.10
13.11
13.12
Interrupts (Cont.)
13.13
Used to avoid programmed I/O (one byte at a time) for large data movement
Bypasses CPU to transfer data directly between I/O device and memory
Count of bytes
Version that is aware of virtual addresses can be even more efficient - DVMA
13.14
13.15
Each OS has its own I/O subsystem structures and device driver frameworks
Character-stream or block
Sequential or random-access
Sharable or dedicated
Speed of operation
13.16
13.17
13.18
Block I/O
Network sockets
For direct manipulation of I/O device specific characteristics, usually an escape / back door
Unix ioctl() call to send arbitrary bits to a device control register and data to device data register
13.19
File mapped to virtual memory and clusters brought via demand paging
DMA
13.20
Network Devices
13.21
ioctl() (on UNIX) covers odd aspects of I/O such as clocks and timers
13.22
Difficult to use
13.23
Synchronous
Asynchronous
13.24
Vectored I/O
Vectored I/O allows one system call to perform multiple I/O operations
For example, Unix readve() accepts a vector of multiple buffers to read into or write from
Avoid for example worry about multiple threads changing data as reads / writes occurring
13.25
Scheduling
Varying sizes
13.26
Device-status Table
13.27
13.28
Key to performance
i.e., Printing
13.29
Error Handling
OS can recover from disk read, device unavailable, transient write failures
Track error frequencies, stop using device with increasing frequency of retry-able errors
13.30
I/O Protection
User process may accidentally or purposefully attempt to disrupt normal operation via illegal I/O
instructions
13.31
13.32
Kernel keeps state info for I/O components, including open file tables, network connections, character
device state
Many, many complex data structures to track buffers, memory allocation, dirty blocks
Message with I/O information passed from user mode into kernel
Pros / cons?
13.33
13.34
Power Management
Computers and devices use electricity, generate heat, frequently require cooling
Wake locks like other locks but prevent sleep of device when lock is held
Only awake enough to respond to external stimuli (button press, incoming call)
13.35
13.36
13.37
STREAMS
STREAM a full-duplex communication channel between a user-level process and a device in Unix
System V and beyond
Asynchronous internally, synchronous where user process communicates with stream head
13.38
13.39
Performance
Data copying
13.40
Intercomputer Communications
13.41
Improving Performance
Use DMA
Balance CPU, memory, bus, and I/O performance for highest throughput
13.42
Device-Functionality Progression
13.43
End of Chapter 13