32#ifndef detail_ut_large_page_alloc_solaris_h
33#define detail_ut_large_page_alloc_solaris_h
38#include "mysqld_error.h"
56 void *ptr = mmap(
nullptr, n_bytes_rounded, PROT_READ | PROT_WRITE,
57 MAP_PRIVATE | MAP_ANON, -1, 0);
60 <<
"large_page_aligned_alloc mmap(" << n_bytes_rounded
66 struct memcntl_mha m = {};
67 m.mha_cmd = MHA_MAPSIZE_VA;
69 int ret = memcntl(ptr, n_bytes_rounded, MC_HAT_ADVISE, (
caddr_t)&m, 0, 0);
72 <<
"large_page_aligned_alloc memcntl(ptr, " << n_bytes_rounded
78 return (ptr != (
void *)-1) ? ptr :
nullptr;
92 auto ret = munmap(ptr, n_bytes_rounded);
95 <<
"large_page_aligned_free munmap(" << ptr <<
", " << n_bytes_rounded
109 int nr_of_pages = getpagesizes(
NULL, 0);
110 std::vector<size_t> supported_page_sizes(nr_of_pages);
111 if (nr_of_pages > 0) {
112 getpagesizes(supported_page_sizes.data(), nr_of_pages);
114 return supported_page_sizes;
const size_t large_page_default_size
System-default huge (large) page setting.
Definition: ut0new.cc:40
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:58
Definition: ut0tuple.h:57
static auto log_warn()
Definition: ut0log.h:452
static auto log_error()
Definition: ut0log.h:453
constexpr size_t pow2_round(size_t n, size_t m)
Calculates the biggest multiple of m that is not bigger than n when m is a power of two.
Definition: helper.h:57
void * large_page_aligned_alloc(size_t n_bytes)
Allocates memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:52
std::vector< size_t > large_page_all_supported_sizes()
Queries all possible page-sizes.
Definition: large_page_alloc-solaris.h:108
bool large_page_aligned_free(void *ptr, size_t n_bytes)
Releases memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:75
size_t large_page_size()
Queries the current size of large (huge) pages on running system.
Definition: large_page_alloc-linux.h:95
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
#define NULL
Definition: types.h:55
__caddr_t caddr_t
Definition: types.h:82
Base of InnoDB utilities.