- Cache coloring
In
computer science , cache coloring (also known as page coloring) is the process of attempt to allocate free pages that are contiguous from theCPU cache 's point of view, in order to maximize the total number of pages cached by the processor. Cache coloring is typically employed by low-leveldynamic memory allocation code in theoperating system , when mappingvirtual memory tophysical memory . 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.Details of operations
Example
For example, if page 10 of physical memory is assigned to page 0 of a process'
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.Implementations
This code adds a significant amount of complexity to the virtual memory allocation subsystem, but the result is well worth the effort.cite web
url = http://www.freebsd.org/doc/en_US.ISO8859-1/articles/vm-design/page-coloring-optimizations.html
title = Page Coloring
accessdate = 2007-01-13
author = Matthew Dillon
authorlink = Matt Dillon (computer scientist)
work = Design elements of the FreeBSD VM system
publisher = FreeBSD Foundation ] Page coloring makes virtual memory as deterministic as physical memory in regard to cache performance. Page coloring is employed inoperating system s such as Solaris [cite web
url = http://www.sun.com/software/solaris/whats_new.jsp
title = Solaris Operating System What's New
accessdate = 2007-01-13
work = Solaris marketing material
publisher = Sun Microsystems, Inc.] ,FreeBSD cite web
url = http://www.freebsd.org/doc/en_US.ISO8859-1/articles/vm-design/page-coloring-optimizations.html
title = Page Coloring
accessdate = 2007-01-13
author = Matthew Dillon
authorlink = Matt Dillon (computer scientist)
work = Design elements of the FreeBSD VM system
publisher = FreeBSD Foundation ] andNetBSD .Notes
References
External links
*" [http://citeseer.ist.psu.edu/kessler92page.html Page Placement Algorithms for Large Real-Indexed Caches] ," by R. E. Kessler, Mark D. Hill, University of Wisconsin, 1992.
*" [http://citeseer.ist.psu.edu/419609.html Colorable Memory] ," by [http://i30www.ira.uka.de/aboutus/inmemoriam/liedtke/index.php?lid=en Jochen Liedtke] , IBM T. J. Watson Center, Nov. 1996. Postscript document [http://i30www.ira.uka.de/research/documents/l4ka/1996/colmem.ps here] .
Wikimedia Foundation. 2010.