5

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?

3 Answers 3

15

Use lscpu. It's in Debian package “util-linux”.

6
  • And if we are not running Debian?
    – Karlson
    Dec 28, 2011 at 19:51
  • 1
    @Karlson: use your package manager to get that package. It is pretty widespread.
    – Mat
    Dec 28, 2011 at 20:03
  • @Mat Assuming of course that the distribution you're running is new enough to have it and secondly that you have root or sudo permissions on the system to install it.
    – Karlson
    Dec 28, 2011 at 20:07
  • 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?".
    – Mat
    Dec 28, 2011 at 20:15
  • 3
    @Karlson: you can't expect answers to cover the whole range of Linux variants that have existed since Linux 0.99. This one, quite pragmatically, answers the question with a widely available tool today. It is good. (Better than saying "Check Wikipedia and your CPU manufacturer's website in my opinion.)
    – Mat
    Dec 28, 2011 at 20:30
4

That is L2 Cache. 6144KB is actually 6MB. You can easily check it on the Wiki or on CPU manufacturer's page.

4

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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .