Computer System Overview: David Duggan
Computer System Overview: David Duggan
Computer System Overview: David Duggan
1/19/2011
1/19/2011
1/19/2011
Processor
Internal registers
Specifies the address for the next read or write Contains data written into memory or receives data read from memory
1/19/2011
User-Visible Registers
May be read by user processes Available to all programs - application programs and system programs Types of registers
Data Address
1/19/2011
Contains the address of an instruction to be fetched Contains the instruction most recently fetched Condition codes Interrupt enable/disable Supervisor/user mode
1/19/2011
1/19/2011
Interrupts
1/19/2011
Interrupt Cycle
1/19/2011
10
Interrupt Timeline
1/19/2011
11
1/19/2011
12
Multiple Interrupts
1/19/2011
13
1/19/2011
14
disk
Net interface
cache-memory: cache misses, write-through/write-back memory-disk: swapping, paging, file accesses memory-network Interface : packet send/receive I/O devices to the processor: interrupts
15
1/19/2011
16
After I/O starts, control returns to user program only upon I/O completion
Wait instruction idles the CPU until operation completes Wait loop (contention for memory access?) At most one I/O request is outstanding at a time, no simultaneous I/O processing
After I/O starts, control returns to user program without waiting for I/O completion
to wait for I/O completion Device-status table contains entry for each I/O device indicating its type, address, and state Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt
17
Programmed I/O
I/O module performs the action, not the processor Sets appropriate bits in the I/O status register No interrupts occur Processor checks status until operation is complete
1/19/2011
18
Interrupt-Driven I/O
Processor is interrupted when I/O module ready to exchange data Processor is free to do other work No needless waiting Consumes a lot of processor time because every byte read or written passes through the processor
1/19/2011
19
Used for high-speed I/O devices able to transmit information at close to memory speeds. Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention. Only one interrupt is generated per block, rather than the one interrupt per byte. Programming a DMA transfer
address of the I/O buffer starting location in memory number of bytes direction of transfer (read/write from/to memory)
Bus arbitration between cache-memory and DMA transfers Memory cache must be consistent with DMA
20
Storage-Device Hierarchy
Decreasing cost per bit Increasing capacity Increasing access time Decreasing frequency of access of the memory by the processor
Locality of reference
Storage Hierarchy
Caching copying information into faster storage system; main memory can be viewed as a last cache for secondary storage.
1/19/2011
22
1/19/2011
23
Cache-Memory Transfers
1/19/2011
24
Cache Memory
The mismatch between processor and memory speed closer to the processor than the main memory; smaller and faster than the main memory contains the value of main memory locations that were recently accessed (temporal locality) transfer between caches and main memory is performed in units called cache blocks/lines contains also the value of memory locations that are close to locations which were recently accessed (spatial locality) Cache performance: miss ratio, miss penalty, average access time invisible to the OS, operated by the hardware/firmware
CSE325 - Computer System 25
1/19/2011
26
1/19/2011
27
Cache Design
Mapping function
Determines which cache location the block will occupy Direct-mapped vs. fully-associative vs. setassociative Conflict misses Determines which block to replace Least-Recently-Used (LRU) algorithm
CSE325 - Computer System 28
Replacement algorithm
1/19/2011
Write policy
When the memory write operation takes place Can occur every time block is updated: write through Can occur only when block is replaced: write back
1/19/2011
29
A portion of main memory used as a buffer to temporarily to hold data for the disk Disk writes are clustered Some data written out may be referenced again. The data are retrieved rapidly from the software cache instead of slowly from disk
1/19/2011
30
Multiprocessors
CPU cache CPU cache Memory memory bus I/O bus
disk
Net interface
more than one processor on the same bus memory is shared among processors-- cache coherency goal: performance speedup single-image operating systems Multi-core processors (chip-level multiprocessors/CMP)
31
Clusters of Computers
CPU cache Memory memory bus I/O bus CPU cache Memory memory bus I/O bus
network
disk
Net interface
Net interface
disk
network of computers: share-nothing communication through message-passing fast interconnects: memory-to-memory communication goals: performance and availability each system runs its own operating system
32