In computer science, cache coloring (also known as page coloring) is the process of attempting to allocate free pages that are contiguous from the CPU cache's point of view, in order to maximize the total number of pages cached by the processor.
A virtual memory subsystem that lacks cache coloring is less deterministic with regards to cache performance, as differences in page allocation from one program run to the next can lead to large differences in program performance.
In this way, sequential pages in virtual memory do not contend for the same cache line.
This code adds a significant amount of complexity to the virtual memory allocation subsystem, but the result is well worth the effort.
Page coloring is employed in operating systems such as Solaris,[2] FreeBSD,[1] NetBSD,[3] and Windows NT.