cache

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

Reply to
khan
Loading thread data ...

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.

Reply to
Tim Clacy

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.

Reply to
Tom Lucas

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.