Tuesday, 17 July 2018

SMP vs MPP

AMP stands for Asymmetric Multi-Processing; SMP means Symmetric Multi-Processing.


AMP system has multiple CPUs, each of which may be a different architecture (but can be the same – i.e. may be either heterogeneous or homogeneous multicore). Each has its own address space (though some or all of the memory may be shared with other cores), and each may or may not run an OS (and the OSes need not be the same). Some kind of communication facility between the CPUs is provided for each.



Symmetric Multicore – SMPLike AMP, an SMP system has multiple CPUs, but in this case each has exactly the same architecture – i.e. it must be a homogeneous multicore design.  CPUs share memory space (or at least some of it). Normally a single OS is used that runs on all the CPUs, dividing work between them - another significant difference from AMP. Some kind of communication facility between the CPUs is provided .





When multiple cores in a processor work concurrently for the kernel, it's desirable to avoid sharing data that's specific to a given core. For this reason, the 2.6 kernel introduced the concept of per-CPU variables that are associated with a single CPU. This permits the declaration of variables for a CPU that are most commonly accessed by that CPU, which minimizes the locking requirements and improves performance..






In an SMP system (or a NUMA system like today's x86 CPUs), all memory is accessible to all CPUs. So CPU0 can initialize all the memory.
There's still room for CPU specific initialization:
  1. Each CPU may allocate a small memory pool for itself, for efficient allocation.
  2. The control register that directs the hardware to the paging tables should be set on each CPU.
  3. A setup or flush of the TLBs (the hardware's address translation cache) may be needed.
Before SMP mode, linux kernel is just executing using the default CPU, which is the boot cpu (cpu0).



In a Symmetric Multiprocessor, the architectural “distance” to any memory location is the same for all processors, i.e. “symmetric”.


In a NonUniform Memory Access machine, each processor is “closer” to some memory locations than others; i.e. memory is partitioned among them Asymmetrically.

No comments:

Post a Comment