Memory Hierarchy

When writing out a large amount of data that will not be read back for a while, what is the main benefit of non-temporal stores that bypass the cache?

  1. AThe written data stays in the cache longer and is faster to read later
  2. BThe cache is not filled with data that won't be reused
  3. CWrite ordering is no longer guaranteed, making program bugs easier to find
Show answer and explanation

Answer: B. The cache is not filled with data that won't be reused

Ordinary stores with write-allocate fetch the line from memory before writing, so even write-only data costs read traffic and evicts other data that will be reused. Non-temporal stores combine writes and send them straight to memory, leaving the cache unpolluted and skipping useless fetches. The data does not stay in the cache, so reading it back soon would be slower. Changed ordering semantics are a caveat, not a benefit.

  • A. The data does not stay cached, so reading it soon is actually slower.
  • B. Correct. The cache is not filled with non-reused data, and useless fetches are avoided.
  • C. Changed ordering is a caveat, not a benefit.
Practice this topic Back to topic

More Memory Hierarchy questions

  1. If the cache hit rate is 95%, what is the miss rate?
  2. Which technique, when fetching a missed line from memory, sends the word the CPU needs first and the rest afterward?
  3. Why does fusing the two loops above into one (loop fusion) tend to be faster when N is large?
  4. Which pair gives the reason a large matrix transpose (b[j][i] = a[i][j]) tends to cause many cache misses, and a typical countermeasure?
  5. In a typical computer's memory hierarchy, which property holds more strongly for upper levels (closer to the CPU)?