This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Wednesday, December 2, 2015

Explain about Linux Memory Huge Pages & Transparent Huge Pages

1.       Memory is managed in blocks known as pages.
2.       A page is 4096 bytes.
3.       1MB of memory is equal to 256 pages;
4.       1GB of memory is equal to 256,000 pages, etc.
5.       CPUs have a built-in memory management unit that contains a list of these pages, with each page referenced through a page table entry

There are two ways to enable the system to manage large amounts of memory:

    Increase the number of page table entries in the hardware memory management unit
    Increase the page size

The first method is expensive, since the hardware memory management unit in a modern processor only supports hundreds or thousands of page table entries.

Red Hat Enterprise Linux 6 implements the second method

  • Simply put, huge pages are blocks of memory that come in 2MB and 1GB sizes.
  • The page tables used by the 2MB pages are suitable for managing multiple gigabytes of memory, whereas the page tables of 1GB pages are best for scaling to terabytes of memory.
  • Huge pages must be assigned at boot time.
  • They are also difficult to manage manually, and often require significant changes to code in order to be used effectively.

THP (transparent huge pages) is an abstraction layer that automates most aspects of creating, managing, and using huge pages.

  • THP hides much of the complexity in using huge pages from system administrators and developers.
  • As the goal of THP is improving performance, its developers (both from the community and Red Hat) have tested and optimized THP across a wide range of systems, configurations, applications, and workloads.
  • This allows the default settings of THP to improve the performance of most system configurations
  • THP is not recommended for database workloads.
  • THP can currently only map anonymous memory regions such as heap and stack space.

No comments:

Post a Comment