Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Details of operations  





2 Implementations  





3 References  





4 External links  














Cache coloring







Add links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Incomputer 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. Cache coloring is typically employed by low-level dynamic memory allocation code in the operating system, when mapping virtual memorytophysical 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

[edit]
Illustration of cache coloring. Left is virtual memory spaces, center is the physical memory space, and right is the CPU cache.

A physically indexed CPU cache is designed such that addresses in adjacent physical memory blocks take different positions ("cache lines") in the cache, but this is not the case when it comes to virtual memory; when virtually adjacent but not physically adjacent memory blocks are allocated, they could potentially both take the same position in the cache. Coloring is a technique implemented in memory management software, which solves this problem by selecting pages that do not contend with neighbor pages.

Physical memory pages are "colored" so that pages with different "colors" have different positions in CPU cache memory. When allocating sequential pages in virtual memory for processes, the kernel collects pages with different "colors" and maps them to the virtual memory. In this way, sequential pages in virtual memory do not contend for the same cache line.

Implementations

[edit]

This code adds a significant amount of complexity to the virtual memory allocation subsystem, but the result is well worth the effort.[1] Page coloring makes virtual memory as deterministic as physical memory with regard to cache performance. Page coloring is employed in operating systems such as Solaris,[2] FreeBSD,[1] NetBSD,[3] and Windows NT.[4]

References

[edit]
  1. ^ a b Matthew Dillon. "Page Coloring". Design elements of the FreeBSD VM system. FreeBSD Foundation. Retrieved 2007-01-13.
  • ^ "Solaris Operating System What's New". Solaris marketing material. Sun Microsystems, Inc. Retrieved 2007-01-13.
  • ^ Matt Thomas. "Improving NetBSD/mips" (PDF). Managing Page Colors. The NetBSD Foundation. Retrieved 2012-09-24.
  • ^ Edouard Bugnion; Jennifer M. Anderson; Todd C. Mowry*; Mendel Rosenblum; Monica S. Lam. "Compiler Directed Page-Coloring for Multiprocessors". Stanford University. Retrieved 2009-10-06.
  • [edit]
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Cache_coloring&oldid=1167615406"

    Category: 
    Cache (computing)
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
     



    This page was last edited on 28 July 2023, at 20:50 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki