I tried to get cache information on my machine as follows
getconf -a | grep -i cache
zodiac@zodioc:~$ getconf -a | grep -i cache
LEVEL1_ICACHE_SIZE 32768
LEVEL1_ICACHE_ASSOC 8
LEVEL1_ICACHE_LINESIZE 64
LEVEL1_DCACHE_SIZE 32768
LEVEL1_DCACHE_ASSOC 8
LEVEL1_DCACHE_LINESIZE 64
LEVEL2_CACHE_SIZE 1048576
LEVEL2_CACHE_ASSOC 8
LEVEL2_CACHE_LINESIZE 64
LEVEL3_CACHE_SIZE 0
LEVEL3_CACHE_ASSOC 0
LEVEL3_CACHE_LINESIZE 0
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0
does this listing means that LINESIZE of my L2 cache is 64 bytes and that L2 cache is divided into units comprising of 8 cache lines(each of 64 bytes in size) ?
David
I'm no cache expert, but after looking around a bit, it appears instead like the each cache level is divided into 64 byte lines, and has a certain level of associativity. However, I couldn't tell you how the CACHE_ASSOC numbers compare to the actual levels. My system shows a level 1 assoc of 2, and a level 2 assoc of 16.
Edit: It looks like it really is just a simple x-ways-of-associativity. From another site I found a simple way to extract the cache data from /sys, and that's what it shows.
Code:
grep . /sys/devices/system/cpu/cpu*/cache/index*/*
No comments:
Post a Comment