Hello all
We ran into an interesting problem today where a Go program making a few 1 GB slices seems to spend forever allocating this memory (Linux, amd64).
A look a perf top showed a very busy compaction_alloc function.
The problem seems to be that the big allocation causes a Transparent Hugepages defrag operation which takes forever.
Disabling THP fixed the problem:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
Disabling defrag also fixed the problem:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
More discussion here:
I suspect this will affect at least RHEL/CentOS 6 and recent Fedoras.
Any thoughts on how to make this better? It would actually be nice to have this big slice backed by hugepages on a THP-capable system.
Regards
Albert