11/9/17 CS 261 Caching
equation for total cache capacity
S * E * B
what are the parts of a cache line?
Tag, then Set Index, then Block Offset
working set
a collection of elements needed repeatedly for a particular computation
cache set
a collection of one or more cache lines
cache
a small, fast memory that acts as a buffer or staging area for a larger, slower memory, data is transferred in blocks
correlation between stride and read throughput
as stride increases, read throughput decreases
correlation between working set size and read throughput
as working set size increases (from main memory to L1) read throughput increases
if a cache set is full, a cache miss requires...
blocks to be replaced or evicted
a cache always begins _______
cold (empty)
write-back
defer update until replacement/eviction, typically used for lower level of memory hierarchy
hit time
delay in accessing data for a cache hit
miss penalty
delay in loading data for a cache miss
what data structure can we use to implement caches?
hash table
larger cache ->
higher hit rate but higher hit time
lower miss rates ->
higher read throughput
capacity miss
if the working set doesn't fit in cache
write-though
immediately update to lower level, typically used for higher level of memory hierarchy
valid flag/bit (on cache line)
indicates whether the value is up-to-date
write-allocate
load then update, typically used write-back caches
read throughput (or "bandwith")
the rate that a program reads data from a memory system
no-write-allocate
update without loading, typically used for write-through caches
how should we handle write misses?
write-allocate, no-write-allocate
how should we handle writes to a cached value?
write-through, write-back
hit ratio (for caches)
# hits / # memory address
miss rate/ratio
# misses / # memory accesses
What does B equal (cache parameter)
# of blocks
What does S equal (cache parameter)
# of cache sets
What does E equal (cache parameter)
# of lines per cache
what is E for Set-associate caches
1 < E < C/B
what is E for direct-mapped caches
E = 1
what is E for Fully-associative caches
E = C/B