Chapter 5. Linux 105
4. Monitor large pages usage by running the following command:
# cat /proc/meminfo | grep Huge
This command produces the following output:
HugePages_Total:
HugePages_Free:
HugePages_Rsvd:
HugePages_Surp:
Hugepagesize:
Where:
– HugePages_Total is the total pages that are allocated on the system for LP usage.
– HugePages_Free is the total free memory available.
– HugePages_Rsvd is the total of large pages that are reserved but not used.
– Hugepagesize is the size of a single LP.
You can monitor large pages by NUMA nodes by running the following command:
# watch -d grep Huge /sys/devices/system/node/node*/meminfo
MicroQuill SmartHeap
MicroQuill SmartHeap is an optimized malloc that is used for SPECcpu2006 publishes for
optimizing performance on selected benchmark components. For more information, see
SmartHeap for SMP: Does your app not scale because of heap contention?, available at:
http://www.microquill.com/smartheapsmp/index.html
Large TOC -mcmodel=medium optimization
The Linux Application Binary Interface (ABI) on the Power Architecture is enhanced to
optimize larger programs. This ABI both simplifies an application build and improves
overall performance.
Previously, the TOC (-mfull-toc) defaulted to a single instruction access form that restricts
the total size of the TOC to 64 KB. This configuration can cause large programs to fail at
compile or link time. Previously, the only effective workaround was to compile with the
-mminimal-toc option (which provides a private TOC for each source file). The minimal TOC
strategy adds a level of indirection that can adversely impact performance.
The -mcmodel=medium option extends the range of the TOC addressing to +/-2 GB. This setup
eliminates most TOC-related build issues. Also, as the Linux ABI TOC includes Global Offset
Table (GOT) and local data, you can enable a number of compiler- and linker-based
optimizations, including TOC pointer relative addressing for local static and constant data.
This setup eliminates a level of indirection and improves the performance of large programs.
Currently, this optimization is only available with Advance Toolchain 4.0 and later.
The medium and large code models are 64-bit only. Advance Toolchain users must remove
old -mminimal-toc options.
Selecting different SMT modes
Linux enables Power SMT capabilities. By default, the system runs at the highest SMT level.
The ppc64_cpu command can be used to force the system kernel to use lower SMT levels (ST
or SMT2 mode).