0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd::info: Probe characteristics for transparent hugepage support.

This commit is contained in:
Jason Volk 2021-02-10 01:21:30 -08:00
parent efca102ef3
commit b39f574ba9
2 changed files with 20 additions and 1 deletions

View file

@ -58,6 +58,8 @@ namespace ircd::info
extern const size_t aio_max;
extern const size_t iov_max;
extern const size_t page_size;
extern const size_t thp_size;
extern const string_view thp_enable;
extern const size_t total_ram;
extern const size_t total_swap;

View file

@ -1004,13 +1004,15 @@ ircd::info::dump_sys_info()
log::logf
{
log::star, log::DEBUG,
"page_size=%zu iov_max=%zd aio_max=%zd aio_reqprio_max=%zd memlock_limit=%s clock_source=%s",
"page_size=%zu iov_max=%zd aio_max=%zd aio_reqprio_max=%zd memlock_limit=%s clock_source=%s thp=%s:%zu",
page_size,
iov_max,
aio_max,
aio_reqprio_max,
pretty(buf[0], iec(allocator::rlimit_memlock())),
clock_source,
between(thp_enable, '[', ']'),
thp_size,
};
//#endif
}
@ -1152,6 +1154,21 @@ ircd::info::page_size
#endif
};
decltype(ircd::info::thp_size)
ircd::info::thp_size
{
sys::get<size_t>("kernel/mm/transparent_hugepage/hpage_pmd_size", 0UL)
};
static char ircd_info_thp_enable_buf[128];
decltype(ircd::info::thp_enable)
ircd::info::thp_enable
{
thp_size?
sys::get(ircd_info_thp_enable_buf, "kernel/mm/transparent_hugepage/enabled"):
string_view{}
};
//
// System information
//