Pages: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
==Huge Pages==
==Huge Pages==
Making pages larger means fewer TLB misses for a given TLB size (due to more pages being supportable in the same amount of memory, due to narrower page identifiers), large mapping/releasing operations will be faster (due to fewer page table entries needing to be handled), and less memory is devoted to page table entries for a given amount of memory being indexed. The downside is possible wastage of main memory (due to pages not being used as completely). A 2002 paper from Navarro et al at Rice proposed transparent operating system support: "[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.2392 Transparent Operating System Support for Superpages]".
Making pages larger means fewer TLB misses for a given TLB size (due to more pages being supportable in the same amount of memory, due to narrower page identifiers), large mapping/releasing operations will be faster (due to fewer page table entries needing to be handled), and less memory is devoted to page table entries for a given amount of memory being indexed. The downside is possible wastage of main memory (due to pages not being used as completely). A 2002 paper from Navarro et al at Rice proposed transparent operating system support: "[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.2392 Transparent Operating System Support for Superpages]".
===Linux===
===Linux===
* They were a [http://lwn.net/Articles/40840/ 2003 Kernel Summit] topic
* They were a [http://lwn.net/Articles/40840/ 2003 Kernel Summit] topic, after seeing first [http://kerneltrap.org/node/418 introduction] in Linux 2.5.36 ([http://linuxgazette.net/155/krishnakumar.html LinuxGazette] primer article)
* <tt>get_large_pages(2)</tt> and <tt>shared_large_pages(2)</tt>, as covered in [http://lwn.net/Articles/6969/ this LWN article] (along with <tt>free_hugepages</tt>, present in kernels 2.5.36-2.5.54) was a first attempt to provide explicit large page support to applications.
* <tt>alloc_hugepages</tt>, <tt>free_hugepages</tt>, <tt>get_large_pages(2)</tt> and <tt>shared_large_pages(2)</tt>, as covered in [http://lwn.net/Articles/6969/ this LWN article] and present in kernels 2.5.36-2.5.54, were a first attempt to provide explicit large page support to applications.
* [http://www.mjmwired.net/kernel/Documentation/vm/hugetlbpage.txt hugetlbfs] and assorted infrastructure replaced these. Mel Gorman's [http://linux-mm.org/HugePages Linux MM wiki] has a good page on hugetlbfs.
 
===Applications===
* [[MySQL]] can use hugetlbfs via the <tt>large-pages</tt> option
* [[kvm]] can use hugetlbfs with the <tt>--mem-path</tt> option since [http://www.linux-kvm.com/content/get-performance-boost-backing-your-kvm-guest-hugetlbfs kvm-62], released in late 2008
* [[kvm]] can use hugetlbfs with the <tt>--mem-path</tt> option since [http://www.linux-kvm.com/content/get-performance-boost-backing-your-kvm-guest-hugetlbfs kvm-62], released in late 2008


===Page Clustering===
==Page Clustering==
Page clustering (implemented by [http://lwn.net/Articles/23785/ William Lee Irwin] for Linux in 2003, and not to be confused with page-granularity [http://lwn.net/Articles/297299/ swap-out clustering]). There's good coverage in this [http://kerneltrap.org/node/620 KernelTrap article]. This is essentially huge pages without hardware support, and therefore with some overhead and no improvements in TLB-relative performance. It was written up in Irwin's 2003 OLS paper, "[http://ols.fedoraproject.org/OLS/Reprints.../Reprint-Irwin-OLS2003.pdf A 2.5 Page Clustering Implementation]".
Page clustering (implemented by [http://lwn.net/Articles/23785/ William Lee Irwin] for Linux in 2003, and not to be confused with page-granularity [http://lwn.net/Articles/297299/ swap-out clustering]). There's good coverage in this [http://kerneltrap.org/node/620 KernelTrap article]. This is essentially huge pages without hardware support, and therefore with some overhead and no improvements in TLB-relative performance. It was written up in Irwin's 2003 OLS paper, "[http://ols.fedoraproject.org/OLS/Reprints.../Reprint-Irwin-OLS2003.pdf A 2.5 Page Clustering Implementation]".