What actually mean by invalidating a cache (data cache or instruction cache)? Is it like whatever address are mapped in cache are made invalid, so that other addresses can be mapped into the cache
cache
Jun 06, 2006
2 Replies
If you invalidate an area of cache, the content will be refreshed from main memory next time that area is read by the CPU. In other words, the content is marked 'not valid' (not correct). 'Invalidate' is the action that makes something 'not valid'; conversely, 'validate' is the action that makes something 'valid'.
NOTE: To make things a little more confusing, at the hardware level, 'invalidate' is sometimes called 'flush' (e.g. Intel use 'invalidate' where ARM use 'flush').
Invalidate/Flush ensures that the CPU reads the correct (valid) data next time it reads cached memory. Conversely, if the CPU writes to memory through a cache supporting write-buffering, the cache is marked 'dirty'. To force the data out to main memory someone needs to 'clean' the buffered area; this might be done manually through cache control, or automatically by the memory manager as needed.
Invalidating or flushing the cache means that all the data (or instructions) that are currently in the cache are no longer to be used and accesses must be made to memory until new values populate the cache.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required