llc
的信息使用 cpuid command
显示缓存在 Linux 上是:
--- cache 3 ---
cache type = unified cache (3)
cache level = 0x3 (3)
self-initializing cache level = true
fully associative cache = false
extra threads sharing this cache = 0x1f (31)
extra processor cores on this die = 0xf (15)
system coherency line size = 0x3f (63)
physical line partitions = 0x0 (0)
ways of associativity = 0x13 (19)
ways of associativity = 0x6 (6)
WBINVD/INVD behavior on lower caches = false
inclusive to lower caches = true
complex cache indexing = true
number of sets - 1 (s) = 24575
为什么有两个ways of associativity
?它在 /sys/devices/system/cpu/cpu0/cache/index3/number_of_sets
中显示 20文件? 20是LLC的关联度吗? ways of associativity = 0x6 (6)
是什么意思?在这里显示?如何区分每个分片有多少个缓存集?谢谢。
我正在使用服务器。版本是:Linux version 4.15.0-122-generic (buildd@lcy01-amd64-010) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)) #124~16.04.1-Ubuntu SMP.
CPU信息为
Architecture: x86_64
CPU operating mode: 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 48
On-line CPU(s) list: 0-47
Number of threads per core: 2
Number of audits per seat: 12
Socket(s): 2
NUMA nodes: 2
Vendor ID: GenuineIntel
CPU series: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
Step: 1
CPU MHz: 2500.119
CPU max MHz: 2900.0000
CPU min MHz: 1200.0000
BogoMIPS: 4401.87
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 30720K
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42 ,44,46
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43 ,45,47
最佳答案
使用 Linux 为您提供的其他数字:
size = bytes_per_line * sets * associativity
30720 KiB = 64 * 24576 * associativity
30720 KiB = 1536 KiB * associativity
30720 KiB / 1536 KiB = associativity
20 = associativity
使用来自https://ark.intel.com/content/www/us/en/ark/products/91767/intel-xeon-processor-e5-2650-v4-30m-cache-2-20-ghz.html的信息和 https://en.wikichip.org/wiki/intel/microarchitectures/broadwell_(client) ) 去检查;这些来源表明,12 个核心中的每一个都有 2.5 MiB(20 路关联)L3 缓存,通过某种环形总线连接(为芯片提供总共 30 MiB 的 L3 缓存)。
使用它作为“双重检查现实”,我假设显示的两种“关联方式”值都是错误的;并且第一个(“关联性的方式= 19”)可能会显示“关联性 - 1”(类似于他们懒得将 1 添加到“组数 - 1”的方式),无需这么说(无需说“方式”结合性 - 1 = 19")。我不知道第二个“关联方式= 6”来自哪里(该芯片对共享 TLB 使用“6 路关联”,因此可能将其显示在错误的位置)。
请注意,您有 2 个芯片(在 2 个插槽中),以上所有内容都是“每个芯片”(它是两个独立的 30 MiB 的 L3 缓存组)。
关于caching - cpuid命令显示信息的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65210283/