| Cache Coloring or Page Coloring is the process by which memory allocation code will attempt to locate free
pages that are contiguous from the point of view
of the cache. For example, if page 10 of physical memory is assigned to page 0 of a
process's virtual memory and the cache can hold 5 pages, the page
coloring code will not assign page 15 of physical memory to page 1 of a process's virtual memory. It would, instead, assign page
21 of physical memory. The page coloring code attempts to avoid assigning page 15 because this maps over the same cache memory as
page 10 and would result in non-optimal caching. This code adds a significant amount of complexity to the VM memory allocation
subsystem, but the result is well worth the effort. Page Coloring makes VM memory as deterministic as physical memory in regards
to cache performance.
|