1

I have a project where I need to get the size of the cache on my Linux machine. I don't know the linux distro, and the /etc/os-release file does not exist. I only know the kernel and architecture:

Kernel: Linux 6.1.20-rt8 Architecture: arm64 

I cannot install libraries onto the machine.

To get the size of the cache, I tried the following methods, all of which failed:

$ lscpu | grep cache L1d cache: unknown size L1i cache: unknown size L2 cache: unknown size 
$ cat /proc/cpuinfo | grep cache $ 
$ ls /sys/devices/system/cpu/cpu*/cache/index*/size ls: /sys/devices/system/cpu/cpu*/cache/index*/size: No such file or directory 
dmesg | grep -i cache [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.405602] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.405623] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.490323] Detected VIPT I-cache on CPU1 [ 0.508655] Detected VIPT I-cache on CPU2 [ 0.526850] Detected VIPT I-cache on CPU3 [ 0.547628] Detected PIPT I-cache on CPU4 [ 0.591655] Detected PIPT I-cache on CPU5 [ 0.762359] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 22.216417] Detected PIPT I-cache on CPU4 [ 22.412738] Detected PIPT I-cache on CPU5 

The /proc/cpu info file:

$ cat /proc/cpuinfo processor : 0 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 1 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 2 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 3 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 4 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 2 processor : 5 BogoMIPS : 16.00 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 2 

The full lscpu:

$ lscpu Architecture: aarch64 Byte Order: Little Endian CPU(s): 6 On-line CPU(s) list: 0-5 Thread(s) per core: 1 Core(s) per socket: 6 Socket(s): 1 NUMA node(s): 1 Vendor ID: ARM Model: 4 Model name: Cortex-A53 Stepping: r0p4 BogoMIPS: 16.00 L1d cache: unknown size L1i cache: unknown size L2 cache: unknown size NUMA node0 CPU(s): 0-5 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid 
10
  • 1
    what kind of CPU does /proc/cpuinfo say you have? (the full cpuinfo and lscpu output would help) Commented Feb 6 at 10:27
  • 2
    and, seeing this is modern multicore machine: which of the several caches do you specifically care about? There isn't "the" CPU cache Commented Feb 6 at 10:27
  • Look at sudo lshw --class cpu. Also your lscpu and other snoopy commands could benefit from running as root, through use of sudo, e.g. sudo lscpu. Read man sudo sudoers. Commented Feb 6 at 15:20
  • hm, are you perhaps running this on virtualized hardware? Commented Feb 6 at 16:50
  • 1
    so, "don't have that software" is easy to solve, and a should really be solved. Commented Feb 12 at 15:01

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.