Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would a region of memory be marked non-cached?

In an embedded application, we have a table describing the various address ranges that are valid on out target board. This table is used to setup the MMU.
The RAM address range is marked as cacheable, but other regions are marked at not cacheable. Why is that?

like image 286
Benoit Avatar asked Sep 18 '08 05:09

Benoit


People also ask

What is non cached memory?

Normal Non-Cacheable memory is not looked-up in any cache. The requests are sent directly to memory. Read requests might over-read in memory, for example, reading 64 bytes of memory for a 4-byte access, and might satisfy multiple memory requests with a single external memory access.

What is non cache?

Dynamic information that changes regularly or for each user request and serves no purpose if it were cached.

What does it mean when memory is cached?

Memory caching (often simply referred to as caching) is a technique in which computer applications temporarily store data in a computer's main memory (i.e., random access memory, or RAM) to enable fast retrievals of that data.

What causes cache memory problems?

Caching as a solution to the performance/latency/throughput problems means there is more complexity, which will lead to more bugs. Bugs with caches can be subtle and difficult to debug, and bugs with caches can also cause live site outages.


1 Answers

This is done so that the processor does not use stale values due to caching. When you access (regular) cached RAM, the processor can "remember" the value that you accessed. The next time you look at that same memory location, the processor will return the value it remembers without looking in RAM. This is caching.

If the content of the location can change without the processor knowing as could be the case if you have a memory mapped device (an FPGA returning some data packets for example), the processor could return the value is "remembered" from last time, which would be wrong.

To avoid this problem, you mark that address space as non-cacheable. This insures the processor does not try to remember the value.

like image 133
Benoit Avatar answered Oct 13 '22 18:10

Benoit