0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::info: Sample system page size from sysconf().

This commit is contained in:
Jason Volk 2018-08-23 01:09:11 -07:00
parent 6c71f43d1b
commit 1748ff843b
2 changed files with 11 additions and 2 deletions

View file

@ -40,6 +40,7 @@ namespace ircd::info
extern const string_view startup;
// System / platform information
extern const size_t page_size;
extern const size_t max_align;
extern const size_t hardware_concurrency;
extern const size_t destructive_interference;

View file

@ -9,6 +9,7 @@
// full license for this software is available in the LICENSE file.
#include <RB_INC_SYS_RESOURCE_H
#include <RB_INC_UNISTD_H
#include <boost/version.hpp>
void
@ -67,11 +68,12 @@ ircd::info::dump()
// IRCd is compiled for and running on.
log::debug
{
"max_align=%zu hw_conc=%zu d_inter=%zu c_inter=%zu",
"page_size=%zu max_align=%zu hw_conc=%zu d_inter=%zu c_inter=%zu",
page_size,
max_align,
hardware_concurrency,
destructive_interference,
constructive_interference
constructive_interference,
};
// This message flashes posix information about the resource limits
@ -242,6 +244,12 @@ ircd::info::rlimit_nofile
_get_rlimit(RLIMIT_NOFILE)
};
decltype(ircd::info::page_size)
ircd::info::page_size
{
size_t(syscall(::sysconf, _SC_PAGESIZE))
};
decltype(ircd::info::max_align)
ircd::info::max_align
{