madvise hugepage on Linux
When working with very large arrays on modern Linux kernels,
you can experience a significant speedup when
transparent hugepage
is used.
The current system policy for transparent hugepages can be seen by:
cat /sys/kernel/mm/transparent_hugepage/enabled
When set to madvise
NumPy will typically use hugepages for a performance
boost. This behaviour can be modified by setting the environment variable:
or setting it to 1
to always enable it. When not set, the default
is to use madvise on Kernels 4.6 and newer. These kernels presumably
experience a large speedup with hugepage support.
This flag is checked at import time.