Ceph is known to suffer from memory fragmentation due to transparent
huge pages (THP). This is indicated by RSS usage above configured memory
targets and is only observable when the distribution default for THP is
"always", which is the default in the upstream kernel if
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is unset.
For now, enabling THP is currently discouraged until selective use of
THP by Ceph is implemented via madvise. We will need to consider both
defaults for THP so madvise calls to both enable and disable THP will
need implemented.
All credit to Mark Nelson for doing the legwork identifying this issue
and potential solutions.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Mark Nelson <mnelson@redhat.com>
.set_flag(Option::FLAG_NO_MON_UPDATE)
.set_description(""),
+ Option("thp", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_flag(Option::FLAG_STARTUP)
+ .set_description("enable transparent huge page (THP) support")
+ .set_long_description("Ceph is known to suffer from memory fragmentation due to THP use. This is indicated by RSS usage above configured memory targets. Enabling THP is currently discouraged until selective use of THP by Ceph is implemented."),
+
Option("key", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("")
.set_description("Authentication key")
if (prctl(PR_SET_DUMPABLE, 1) == -1) {
cerr << "warning: unable to set dumpable flag: " << cpp_strerror(errno) << std::endl;
}
+# if defined(PR_SET_THP_DISABLE)
+ if (!g_conf().get_val<bool>("thp") && prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0) == -1) {
+ cerr << "warning: unable to disable THP: " << cpp_strerror(errno) << std::endl;
+ }
+# endif
#endif
//