Cache Pollution - Solutions

Solutions

Other solutions to this problem involve the use of specialized hardware instructions such as "lvxl" provided by PowerPC AltiVec. This instruction loads a 128 bit wide value into a register and marks the corresponding cache block as "least recently used" i.e. as the prime candidate for eviction upon a need to evict a block from its cache set. To appropriately use that instruction in the context of the above example, the data elements referenced by the loop would have to be loaded using this instruction. When implemented in this manner, cache pollution would not take place, since the execution of such loop would not cause premature eviction of T from cache. This would be avoided because, as the loop would progress, the addresses of the elements in C would map to the same cache way, leaving the actually older (but not marked as "least recently used") data intact on the other way(s). Only the oldest data (not pertinent for the example given) would be evicted from cache, which T is not a member of, since its update occurs right before the loop's start.

Yet other possible solutions involve the operating system. For example, the pages in main memory that correspond to the C data array can be marked as "caching inhibited" or, in other words, non-cacheable. However, in the above program's example, such manipulations do not appear to improve execution performance, since the resulting run time overhead is overwhelmingly larger than any gain achievable by cache pollution avoidance (unless the memory region has been non-cacheable to begin with).

Often in real life the cache is composed of more than one level (called the "L1", "L2" etc.). Therefore, "cache pollution" is well-defined only for situations where the term "cache" is unambiguous. Otherwise, it is imperative to specify which level of cache is involved.

Read more about this topic:  Cache Pollution

Famous quotes containing the word solutions:

    The anorexic prefigures this culture in rather a poetic fashion by trying to keep it at bay. He refuses lack. He says: I lack nothing, therefore I shall not eat. With the overweight person, it is the opposite: he refuses fullness, repletion. He says, I lack everything, so I will eat anything at all. The anorexic staves off lack by emptiness, the overweight person staves off fullness by excess. Both are homeopathic final solutions, solutions by extermination.
    Jean Baudrillard (b. 1929)

    Every man is in a state of conflict, owing to his attempt to reconcile himself and his relationship with life to his conception of harmony. This conflict makes his soul a battlefield, where the forces that wish this reconciliation fight those that do not and reject the alternative solutions they offer. Works of art are attempts to fight out this conflict in the imaginative world.
    Rebecca West (1892–1983)

    Science fiction writers foresee the inevitable, and although problems and catastrophes may be inevitable, solutions are not.
    Isaac Asimov (1920–1992)