UMA1(Uniform Memory Access, 一致性内存访问 ):总线模型保证了 CPU 的所有内存访问都是一致的,不必考虑不同内存地址之间的差异。
NUMA2(Non-Uniform Memory Access, 非一致性内存访问)
1.命令:numactl --hardware
root@OK8MP:/sys/devices/system/cpu# numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3
node 0 size: 921 MB
node 0 free: 316 MB
node distances:
node 0
0: 10
root@OK8MP:/sys/devices/system/cpu# cat /proc/cpuinfo
processor : 0
BogoMIPS : 16.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
BogoMIPS : 16.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
BogoMIPS : 16.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
BogoMIPS : 16.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
root@OK8MP:/sys/devices/system/cpu# lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1600.0000
CPU min MHz: 1200.0000
BogoMIPS: 16.00
NUMA node0 CPU(s): 0-3
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
root@OK8MP:/sys/devices/system/cpu/cpu2# cat online
1
root@OK8MP:/sys/devices/system/cpu/cpu2# echo 0 > /sys/devices/system/cpu/cpu2/online
[ 5215.836217] CPU2: shutdown
[ 5215.838932] psci: CPU2 killed (polled 0 ms)
root@OK8MP:/sys/devices/system/cpu/cpu2# numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 3
node 0 size: 921 MB
node 0 free: 316 MB
node distances:
node 0
0: 10
root@OK8MP:/sys/devices/system/cpu/cpu2# echo 1 > /sys/devices/system/cpu/cpu2/online
[ 5304.404259] Detected VIPT I-cache on CPU2
[ 5304.404282] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[ 5304.404320] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
root@OK8MP:/sys/devices/system/cpu/cpu2# numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3
node 0 size: 921 MB
node 0 free: 316 MB
node distances:
node 0
0: 10
root@OK8MP:/sys/devices/system/cpu/cpu2#
每个程序员都应该知道的 CPU 知识:NUMA - 知乎 (zhihu.com)
十年后数据库还是不敢拥抱NUMA? - 知乎 (zhihu.com)
讲解CPU之NUMA硬件体系以及机制(lscpu查看相关信息) - jinzi - 博客园 (cnblogs.com)