Ubuntu Tutorials - Herong's Tutorial Examples - v1.25, by Herong Yang
List CPU Caches and Their Sizes
This section describes how to use 'lscpu', 'lshw' and 'dmidecode' commands to list CPU caches and their sizes.
You can different Ubuntu commands to list CPU caches and their sizes, lscpu, lshw and dmidecode, as described below.
"lscpu" - Display CPU Caches - "lscpu" command displays information about the CPU and its caches. The following output shows 4 CPU caches.
herong$ lscpu Architecture: x86_64 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: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 69 Model name: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz Stepping: 1 CPU MHz: 877.974 CPU max MHz: 2900.0000 CPU min MHz: 800.0000 BogoMIPS: 4988.41 Virtualisation: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 3072K ...
"lshw" - Display CPU Caches - "lshw" command displays hardware configurations including CPU caches. The following output shows multiple CPUs with 3 caches connected each CPU.
herong$ sudo lscpu
description: Computer
width: 64 bits
capabilities: smp vsyscall32
*-core
description: Motherboard
physical id: 0
*-memory
description: System memory
physical id: 0
size: 3622MiB
*-cpu
product: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
vendor: Intel Corp.
physical id: 1
bus info: cpu@0
size: 1940MHz
capacity: 2900MHz
width: 64 bits
...
"dmidecode" - Display CPU Caches - "dmidecode" command decodes DMI (Direct Media Interface), also called SMBIOS, information including CPU caches. The following output shows 3 CPU caches:
herong$ sudo dmidecode # dmidecode 3.1 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. 62 structures occupying 2490 bytes. Table at 0xDCD3D000. Handle 0x0000, DMI type 4, 42 bytes Processor Information ... Handle 0x0001, DMI type 7, 19 bytes Cache Information Socket Designation: L1-Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 kB ... Handle 0x0002, DMI type 7, 19 bytes Cache Information Socket Designation: L1-Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 kB ... Handle 0x0003, DMI type 7, 19 bytes Cache Information Socket Designation: L2-Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 256 kB ... Handle 0x0004, DMI type 7, 19 bytes Cache Information Socket Designation: L3-Cache Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 3072 kB Maximum Size: 3072 kB ... ...
Table of Contents
Introduction to Ubuntu Systems
GNOME - Desktop Interface and Environment
Shell - The Command-Line Interpreter
Layers of Memory and Access Speed
►List CPU Caches and Their Sizes
Virtual Memory vs. Physical Memory
Buffer Memory and Cache Memory
Verify Cache Memory with "cp" Command
Virtual Memory Mapping and Page Table
"ps -o rss,drs,trs,vsz,sz" - Process Status Options
smem - Process Memory Usage Report
/proc/{id}/maps - Process Memory Map
/proc/{id}/smaps - Process Memory Map Details
earlyoom - A Simple OOM Killer