Under Linux, you can use the following tools to query the CPU cache:
Mode 1:
$ lscpu
L1D cache: 32K <span style= "White-space:pre" ></span> (First level data cache) l1i cache: 32K <span style= " White-space:pre "></span><span style=" font-family:arial, Helvetica, Sans-serif; " > (First order cache) </SPAN>L2 cache: 256K <span style= "White-space:pre" ></span> (Level two cache) L3 cache: 8192k<span style= "White-space:pre" ></span> (Level three cache)
Mode 2:
$ cat /sys/devices/system/cpu/cpu0/cache/index0/size32K
$ cat /sys/devices/system/cpu/cpu0/cache/index0/level1
$ cat /sys/devices/system/cpu/cpu0/cache/index1/size32K
$ cat /sys/devices/system/cpu/cpu0/cache/index1/level1
$ cat /sys/devices/system/cpu/cpu0/cache/index2/size256K$ cat /sys/devices/system/cpu/cpu0/cache/index2/level2
$ cat/sys/devices/system/cpu/cpu0/cache/index3/size8192k
$ cat /sys/devices/system/cpu/cpu0/cache/index3/level3
Mode 3:
$ sudo dmidecode -t cache
However, the results and the above have a way out, the display of the L1 cache is 256kB, the L2 cache is a KB, counted 8 cores, but also inconsistent with the implementation.
There may be some problems with the program itself, not recommended with Dmidecode.
# Dmidecode 2.12SMBIOS 2.7 present. Handle 0x003b, DMI type 7, Bytescache informationsocket designation:cpu Internal l1configuration:enabled, not Sockete D, Level 1Operational mode:write backlocation:internalinstalled size:256 kbmaximum size:256 kbhandle 0x003c, DMI type 7, Bytescache informationsocket designation:cpu Internal l2configuration:enabled, not socketed, level 2Operational Mo De:write backlocation:internalinstalled size:1024 kbmaximum size:1024 kbhandle 0x003d, DMI type 7, BytesCache Infor Mationsocket designation:cpu Internal l3configuration:enabled, not socketed, level 3Operational mode:write backlocation : internalinstalled size:8192 kbmaximum size:8192 KB
Mode 4:
$ cat/proc/cpuinfo
Cache size:8192 KB
This only shows the size of the L3 cache and is not accurate.