VirtualMemory/Problem 1

As caches increase in size, blocks often increase in size as well.

If a large instruction cache has larger blocks, is there still a need for pre-fetching?

Is there a need for data pre-fetch instructions when data blocks get larger?

Solution

Program basic blocks are often short (less than 10 instructions). Even program run blocks, sequences of instructions executed between branches, are not very long. Pre-fetching obtains the next sequential block, but program execution does not continue to follow location PC, PC + 4, PC +8, ... for very long. So as blocks get larger the probability that a program will not execute all instructions in the block, but rather take a branch to another instruction address, increases. Pre-fetching instructions benefit performance when the program continues straight-line execution into the next block. So as instruction cache blocks increase in size, pre-fetching becomes less attractive.

Data structures often comprise lengthy sequences of memory addresses. Program access of a data structure often takes the form of a sequential sweep. Large data blocks work well with such access patterns; pre- fetching is likely still of value due to the highly sequential access patterns. The efficiency of data pre-fetch can be enhanced through a suitable grouping of the data items taking the block limitations into account. This is especially noteworthy when the data-structure exceeds the cache size. Under such circumstances, it will become of critical importance to limit the amount of out-of-cache block references.

This problem was adapted from: "Exercises for Computer Architecture", Anders Ardo, Lund University