Lscpu does not provide the number of cache sets or cache ways that my hardware has, it only gives the cache size which is not enough for me. Is there any way to get these info on Linux?
Asked
Active
Viewed 297 times
0
-
1Semi-related: [Programmatically get accurate CPU cache hierarchy information on Linux](https://stackoverflow.com/q/61454437) but that might just be finding total sizes, and being more concerned about the NUMA topology of which cores share which caches. Looks like [Problem with the information displayed by the cpuid command](https://stackoverflow.com/q/65210283) has some info on cache associativity, mentioning `/sys/devices/system/cpu/cpu0/cache/index3/number_of_sets` for example. – Peter Cordes Sep 15 '22 at 20:35
-
1Also [How to get the size of the CPU cache in Linux](https://stackoverflow.com/q/30207256) shows that `getconf` reports associativity along with size, so you can calculate number of sets from `size/line_size/associativity`. – Peter Cordes Sep 15 '22 at 20:37