Why Choose A Multiprocessor?
Why Choose A Multiprocessor?
• Multiple users
• Multiple applications
Shared Memory
• Processors communicate with shared address space
• Processors communicate by memory read/write
• Easy on small-scale machines
• UMA or NUMA
Shared-Memory Processors
Single copy of the OS (although some parts might be parallel)
relatively easy to program and port sequential code to
difficult to scale to large numbers of processors
processor
1
processor
2
... processor
N
interconnection network
memory
1
memory
2
... memory
M
NUMA
• Non-Uniform Memory Access
• Access to some parts of memory is faster for some
processors than other parts of memory.
• Harder to program, but scales to more processors
Bus Based UMA
(a) Simplest MP:
More than one processor on a single bus
connect to memory, bus bandwidth becomes
a bottleneck.
(b) Each processor has a cache to reduce the need
to access to memory.
(c) To further scale the number of processors, each
processor is given private local memory.
NUMA
• All memories can be addressed by all
processors, but access to a processor’s
own local memory is faster than access to
another processor’s remote memory.
• Looks like a distributed machine, but the
interconnection network is usually
custom-designed switches and/or buses.
NUMA
OS Option 1
Each CPU has its own OS
• Statically allocate physical memory to each CPU
• Each CPU runs its own independents OS
• Share peripherals
• Each CPU handles its processes system calls
• Used in early multiprocessor systems
• Simple to implement
• Issues: 1. Each processor has its own scheduling queue.
2. Each processor has its own memory partition.
3. Consistency is an issue with independent disk buffer caches and
potentially shared files.
OS Option 2
Master-Slave Multiprocessors
• OS mostly runs on a single fixed CPU.
• User-level applications run on the other CPUs.
• All system calls are passed to the Master CPU for processing
• Memory can be allocated as needed to all CPUs.
• Issues: Master CPU becomes the bottleneck.