5.5.3.4 Remap_file_pages

Remap_file_pages is another memory management feature that is suitable for large memory and database
applications. It is primarily useful for x86 systems that use the shared memory file system (shmemfs). A
shmemfs memory segment requires kernel structures for control and mapping functions, and these structures
can grow unacceptably large given a large enough segment and multiple sharers.
For example, a 512 MB segment requires approximately 1 MB of kernel mapping structures per accessing
process. Large database applications that create hundreds of concurrent threads (one for each SQL query, for
example) can quickly consume all available free kernel address space. The Remap_file_pages feature
modifies the shmemfs management structures, so they are significantly smaller (less than 100 bytes). This
permits much larger shmemfs segments, and thousands of concurrent users to be supported.
This section describes dynamic memory used by the kernel, and describes the object reuse requirement. This
section also discusses the three sections of kernel memory management: Page Frame Management, Memory
Area Management, and Noncontiguous Memory Area Management.

5.5.3.5 Page frame management

The fundamental unit of memory under Linux is the page, a non-overlapping region of contiguous memory.
SLES uses 4 KB pages for most processors as the standard memory allocation unit. The kernel keeps track of
the current status of each page frame and distinguishes the page frames that are used to contain pages that
belong to processes from those that contain kernel code and data. Page frames that are to be used by
processes are allocated with the get_zeroed_page() routine. The routine invokes the function
alloc_pages(). The routine then fills the page frame it obtained with zeros by calling clear_page(),
thus satisfying the object reuse requirement.
127
Figure 5-67: Remap_ file_ pages for database applications