See cache sizes in a machine

This post documents the commands to use for finding out the L1, L2 and L3 cache sizes of a machine on Linux.

This post follows my experience on a dual socket Intel E5-2695-v2 CPU.

 

cat /proc/cpuinfo

shows you last level cache size information,

E5-2695-v2, shows

model name : Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz

stepping : 4

microcode : 0x415

cpu MHz : 1200.000

cache size : 30720 KB

Apparently if you googled the CPU info, it also shows 30MB smart cache.

 

 

If you have sudo access

sudo dmidecode -t cache

 

Cache Information

Socket Designation: L1 Cache

Configuration: Enabled, Not Socketed, Level 1

Operational Mode: Write Back

Location: Internal

Installed Size: 768 kB

Maximum Size: 768 kB

 

Socket Designation: L2 Cache

Configuration: Enabled, Not Socketed, Level 2

Operational Mode: Write Back

Location: Internal

Installed Size: 3072 kB

Maximum Size: 3072 kB

 

Socket Designation: L3 Cache

Configuration: Enabled, Not Socketed, Level 3

Operational Mode: Write Back

Location: Internal

Installed Size: 30720 kB

Maximum Size: 30720 kB

 

Noticing the numbers here are all aggregated size.

so for L1 cache, it is 64 KB/core = 768 KB / 12 cores

L2 cache, it is 256 KB/core = 3072 KB/12 cores

 

Another useful command

lscpu

 

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              30720K

 

This time, it further breakes down L1 cache into 32K data cache and 32K instruction cache.

 

Advertisements
This entry was posted in Tools, Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s