多核技术虽然在性能上比传统的uniprocessiing优越,但是在设计上有很多挑战。几个很明显的问题包括如何将不同应用负载到多cpu的问题和资源调度共享问题等等。诸如这些问题的考虑,多核设计上出现了AMP、SMP以及BMP架构。
Asymmetric multiprocessing (AMP):
A separate OS, or a separate instantiation of the same OS, runs on each CPU.
Some systems use asymmetric multiprocessing, in which each processor is assigned a specific task. A master processor controls the system; the other processors either look to the master for instruction or have predefined tasks. The scheme defines a master-slave relationship. The master processor schedules and allocates work to the slave processors.
With AMP, you decide how the shared hardware resources used by applications are divided up between the CPUs. Normally, this resource allocation occurs statically during boot time and includes physical memory allocation, peripheral usage, and interrupt handling. While the system could allocate the resources dynamically, doing so would entail complex coordination between the CPUs.
In an AMP system, a process always runs on the same CPU, even when other CPUs run idle. As a result, one CPU can end up being under- or overutilized. To address the problem, the system could allow applications to migrate dynamically from CPU to another. Doing so, however, can involve complex checkpointing of state information or a possible service interruption as the application is stopped on one CPU and restarted on another. Also, such migration is difficult, if not impossible, if the CPUs run different OSs.
Symmetric multiprocessing (SMP):
A single instantiation of an OS manages all CPUs simultaneously, and applications can float to any of them.
The most common systems use symmetric multiprocessing (SMP), in which each processor performs all tasks within the operating system. SMP means that all processors are peers; no master-slave relationship exists between processors.SMP(symmetric multiprocessing)is the processing of programs by multiple processors that share a common operating system and memory. In symmetric (or "tightly coupled") multiprocessing, the processors share memory and the I/O bus or data path. A single copy of the operating system is in charge of all the processors. SMP, also known as a "shared everything" system, does not usually exceed 16 processors.
Symmetric multiprocessing addresses the issue by running only one copy of Neutrino on all of the system's CPUs. Because the OS has insight into all system elements at all times, it can allocate resources on the multiple CPUs with little or no input from the application designer.
Bound multiprocessing (BMP):
A single instantiation of an OS manages all CPUs simultaneously, but each application is locked to a specific CPU.
As with SMP, a single copy of the OS maintains an overall view of all system resources, allowing them to be dynamically allocated and shared among applications. But, during application initialization, a setting determined by the system designer forces all of an application's threads to execute only on a specified CPU.
Compared to full, floating SMP operation, this approach offers several advantages:
- It eliminates the cache thrashing that can reduce performance in an SMP system by allowing applications that share the same data set to run exclusively on the same CPU.
- It offers simpler application debugging than SMP since all execution threads within an application run on a single CPU.
- It helps legacy applications that use poor techniques for synchronizing shared data to run correctly, again by letting them run on a single CPU.
The most difference between AMP, SMP, and BMP as bellow:
- AMP works well with legacy applications, but has limited scalability beyond two CPUs.
- SMP offers transparent resource management, but software that hasn't been properly designed for concurrency might have problems.
- BMP offers many of the same benefits as SMP, but guarantees that uniprocessor applications will behave correctly, greatly simplifying the migration of legacy software.
详情请参考: http://www.qnx.org/developers/docs/6.3.2/neutrino/sys_arch/smp.html