Change opt.metadata_thp to [disabled,auto,always].

To avoid the high RSS caused by THP + low usage arena (i.e. THP becomes a
significant percentage), added a new "auto" option which will only start using
THP after a base allocator used up the first THP region.  Starting from the
second hugepage (in a single arena), "auto" behaves the same as "always",
i.e. madvise hugepage right away.
This commit is contained in:
Qi Wang
2017-08-24 14:29:28 -07:00
committed by Qi Wang
parent ea91dfa58e
commit 47b20bb654
10 changed files with 84 additions and 25 deletions

View File

@@ -919,13 +919,15 @@ mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".decay",
<varlistentry id="opt.metadata_thp">
<term>
<mallctl>opt.metadata_thp</mallctl>
(<type>bool</type>)
(<type>const char *</type>)
<literal>r-</literal>
</term>
<listitem><para>If true, allow jemalloc to use transparent huge page
(THP) for internal metadata (see <link
linkend="stats.metadata">stats.metadata</link> for details). This
option is disabled by default.</para></listitem>
<listitem><para>Controls whether to allow jemalloc to use transparent
huge page (THP) for internal metadata (see <link
linkend="stats.metadata">stats.metadata</link>). <quote>always</quote>
allows such usage. <quote>auto</quote> uses no THP initially, but may
begin to do so when metadata usage reaches certain level. The default
is <quote>disabled</quote>.</para></listitem>
</varlistentry>
<varlistentry id="opt.retain">