Operating Systems Multiprocessor Hardware (5) G NUMA Multiprocessor Characteristics H Single address space visible to all CPUs E Access to remote memory via commands load and Store E Access to remote memory slower than to local memory Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University NUMA Multiprocessor Characteristics Single address space visible to all CPUs Access to remote memory via commands LOAD and STORE Access to remote memory slower than to local memory Multiprocessor Hardware (5)
Multiprocessor OS Types(1) tting Systems CPU 1 CPU 2 CPU 3 CPU 4 Memory Has Has H H Data Data rivate pn vate private p rivate OS Data I Data OS code Bus Each CPu has its own operating system H Statically divide memory into n parts E Give each CPu its own private memory and its own private copy of the os H Each os has its own table, no sharing of processes; no sharing of pages: inconsistent buffer cache Gao Haichang, Software School, Xidian University 14
Operating Systems Gao Haichang , Software School, Xidian University 14 Multiprocessor OS Types (1) Each CPU has its own operating system Bus Statically divide memory into n parts. Give each CPU its own private memory and its own private copy of the OS. Each OS has its own table, no sharing of processes; no sharing of pages; inconsistent buffer cache
Multiprocessor OS Types (2) tting Systems CPU 1 CPU 2 CPU 3 CPU 4 Memory Master Slave Slave Slave User runs runs user runs user runs user processes OS processes processes processes ●s BU Master-Slave multiprocessors H One copy of the os and its table is present on CPU1 H All system calls are redirected to CPUl for processing H Dis: With many CPUs, the master will become a bottleneck Gao Haichang, Software School, Xidian University 15
Operating Systems Gao Haichang , Software School, Xidian University 15 Multiprocessor OS Types (2) Master-Slave multiprocessors Bus One copy of the OS and its table is present on CPU1. All system calls are redirected to CPU1 for processing. Dis: With many CPUs, the master will become a bottleneck
Multiprocessor OS Types 3) tting Systems CPU 1 CPU 2 CPU 3 CPU 4 Memory vO Runs Rt Runs users and users and users and users and shared OS hared os shared os shared OS Locks Bus g Symmetric Multiprocessors H There is one copy of the os in memory, but any CPu can run H Associate a mutex(i.e, lock)with the Os, making the whole system one big critical region Gao Haichang, Software School, Xidian University 16
Operating Systems Gao Haichang , Software School, Xidian University 16 Multiprocessor OS Types (3) Symmetric Multiprocessors There is one copy of the OS in memory, but any CPU can run it. Associate a mutex (i.e., lock) with the OS, making the whole system one big critical region. Bus
Operating Systems Multiprocessor Synchronization 1) CPU 1 Word 1000is Memory CPU 2 initially o 1. CPU 1 reads a O 2. CPU 2 reads a O 3. CPU 1 writes a 1 4. CPU 2 writes a 1 Bus g tSL instruction can fail if the bus cannot be locked G To prevent this problem, the TSL instruction must first lock the bus, preventing other CPUs from accessing it then do both memory accesses, then unblock the bus Gao Haichang, Software School, Xidian University 17
Operating Systems Gao Haichang , Software School, Xidian University 17 Multiprocessor Synchronization (1) TSL instruction can fail if the bus cannot be locked To prevent this problem, the TSL instruction must first lock the bus, preventing other CPUs from accessing it, then do both memory accesses, then unblock the bus