When I look in /proc/cpuinfo, one of the lines tells me I have 6144 KB of cache. Is this L1 cache, L2 cache, or the sum of both of them?
In any case, how do I find out how much L1 and L2 cache my system has?
Use lscpu
. It's in Debian package “util-linux”.
root
or sudo
permissions on the system to install it.
lscpu
has existed since 2008 according to its copyright info in the source code, util-linux
has been around since at least 2006. lscpu
only depends on libc
and the dynamic linker. If you don't have root (and can't build the source), just extract it from a binary package for a reasonably similar distro and chances are it'll work. Sure there are other options, but that's a pretty good answer to the question "how do I find out how much Lx cache I have?".
That is L2 Cache. 6144KB is actually 6MB. You can easily check it on the Wiki or on CPU manufacturer's page.
You can also use dmidecode
. dmidecode -t cache
should give you the info about the caches present and their individual sizes (also checkout the other options of dmidecode
, a very useful tool).