Basic knowlege of memory arch
why
- to solve the mismatch of cpu and memory speed, avoid cpu hungry
- to decrease the frequency memory access from cpu, and access cpu cache if that have to happen
- do every effort to avoid missing hit of cpu cache
what
SMP(UMA)
一致性内存架构,早期的架构,多个CPU共享使用一块物理内存,总线硬件负责协调各CPU对内存的访问,所以对各个CPU来说,看到的内存数据是一致的,所以才叫做Uniform Memory Access
MPP
针对SMP share one memory的缺点,设计分布式存储器模式,every cpu have their own individual memory, called a node, all the node are full connected as one system, the consistency among nodes is guaranted by software not hardware(bus)。每个CPU只能访问自己的本地内存,这样可以提高各个cpu的运行效率,避免对单一的内存忙等
NUMA
非一致性内存架构,参考了MPP的设计,但是允许cpu访问非本地的内存,也就是说cpu对内存的访问分为local access and remote access,访问时间是不一致的,远程访问的速度当然要慢些
缺点是在共享内存时维持高速缓存一致性的开销非常大,尤其时当多处理器快速连续的尝试访问相同的内存区时问题更突出,解决方法有:使用缓存一致性协议(MESIF,SCI)尽量减少需要维护缓存一致性的通信
所以,NUMA设计的重点是让处理器快速的访问在同一单元的内存