If you only "use" a small portion of the cache line after pulling in a cache line, then your program has poor spatial locality.
As we could see with Ray Trace/Ocean (on the previous slide), larger cache lines with poor spatial locality caused an increase of bandwidth -- more data has to be pulled in on each miss, and the misses still happen a decent amount due to the poor spatial locality.
Thus, if your program is "bandwidth limited" and had poor spatial locality, then having a large cache line would be pretty bad.
This comment was marked helpful 2 times.
kayvonf
Nice!
This comment was marked helpful 0 times.
asinha
If the programmer of this cache makes a mistake in the tradeoff between interconnect traffic and fewer misses, could this not be the source of a security vulnerability? I was reading on wikipedia about cache poisoning attacks where the attacker causes irrelevant data to be cached, which in this case would mean there would be much more traffic trying to retrieve the correct data, possibly causing a dramatic slowdown in the program or corrupting the cache.
This comment was marked helpful 0 times.
Q_Q
Is there a way for a program to determine the cache line size of the machine it is operating on? If it could I suppose to could optimize its data structure layout to obtain more performance
This comment was marked helpful 0 times.
arjunh
@Q_Q Here is a possible solution. The nice thing is that is works on Linux, Windows and OSX operating systems.
If you only "use" a small portion of the cache line after pulling in a cache line, then your program has poor spatial locality.
As we could see with Ray Trace/Ocean (on the previous slide), larger cache lines with poor spatial locality caused an increase of bandwidth -- more data has to be pulled in on each miss, and the misses still happen a decent amount due to the poor spatial locality.
Thus, if your program is "bandwidth limited" and had poor spatial locality, then having a large cache line would be pretty bad.
This comment was marked helpful 2 times.
Nice!
This comment was marked helpful 0 times.
If the programmer of this cache makes a mistake in the tradeoff between interconnect traffic and fewer misses, could this not be the source of a security vulnerability? I was reading on wikipedia about cache poisoning attacks where the attacker causes irrelevant data to be cached, which in this case would mean there would be much more traffic trying to retrieve the correct data, possibly causing a dramatic slowdown in the program or corrupting the cache.
This comment was marked helpful 0 times.
Is there a way for a program to determine the cache line size of the machine it is operating on? If it could I suppose to could optimize its data structure layout to obtain more performance
This comment was marked helpful 0 times.
@Q_Q Here is a possible solution. The nice thing is that is works on Linux, Windows and OSX operating systems.
This comment was marked helpful 1 times.