Big slices vs Linux THP defrag

248 views
Skip to first unread message

Albert Strasheim

unread,
Jul 18, 2012, 10:51:32 AM7/18/12
to golan...@googlegroups.com
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

Kirill A. Shutemov

unread,
Jul 19, 2012, 3:31:28 PM7/19/12
to Albert Strasheim, golan...@googlegroups.com
On Wed, Jul 18, 2012 at 07:51:32AM -0700, Albert Strasheim wrote:
> 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).

Could you show code which demonstrate the issue?

--
Kirill A. Shutemov

Albert Strasheim

unread,
Sep 24, 2012, 10:05:49 AM9/24/12
to golan...@googlegroups.com, Albert Strasheim, kir...@shutemov.name
Hello
I was triggering this consistently today, however not with Go code, but with a Go build that was linking lots of commands:


Regards

Albert
Reply all
Reply to author
Forward
0 new messages