How to retain low-end memory
Environment:
Red Hat Enterprise Linux (RHEL) 5.x (x86)
In x86 high-memory devices, when a user's process uses mlock () to allocate a large amount of memory in a common area, the lowmem memory that can be reused may be insufficient, and some system calls will fail and display"Eagain"Errors.
In RHEL 5.x (x86), end users can useLowmem_reserve_ratioControls the reserved lowmem.
Details
# Cat/proc/sys/Vm/lowmem_reserve_ratio
256 256 32
DMA normal highmem
In the general area, 256 pages are retained (default ).
To retain page 512 in the general area:
# Echo "256 512 32">/proc/sys/Vm/lowmem_reserve_ratio
# Cat/proc/sys/Vm/lowmem_reserve_ratio
256 512 32
To set a permanent value, Edit/Etc/sysctl. confAnd add the following content:
VM. lowmem_reserve_ratio = 256 512 32
# Sysctl-P
# Cat/proc/sys/Vm/lowmem_reserve_ratio
256 512 32