diff options
author | Daniel Black <daniel@mariadb.org> | 2020-11-19 11:36:50 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2020-11-19 11:36:53 +1100 |
commit | 5dd5a4af66eba61803d8fc49830c1c06459018e6 (patch) | |
tree | 71b3bdfd32c4276e4df4b0629219210c11fe9c8a | |
parent | eac66522e555a017762fa08c8303ba3c13623eb8 (diff) | |
download | mariadb-git-bb-10.5-danielblack-MDEV-24125-large-pages2.tar.gz |
MDEV-24125: large_pages MAP_HUGE_SHIFTbb-10.5-danielblack-MDEV-24125-large-pages2
MAP_HUGE_SHIFT is constant across achitectures. Define
if it isn't already.
-rw-r--r-- | mysys/my_largepage.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c index c3fc97ffe0a..f91d8753ffc 100644 --- a/mysys/my_largepage.c +++ b/mysys/my_largepage.c @@ -26,6 +26,9 @@ #ifdef HAVE_LINUX_MMAN_H #include <linux/mman.h> #endif +#ifndef MAP_HUGE_SHIFT +#define MAP_HUGE_SHIFT 26 +#endif #ifdef HAVE_SOLARIS_LARGE_PAGES #if defined(__sun__) && defined(__GNUC__) && defined(__cplusplus) \ @@ -329,12 +332,7 @@ uchar *my_large_malloc(size_t *size, myf my_flags) if (large_page_size) { #if defined(MAP_HUGETLB) /* linux 2.6.32 */ - mapflag|= MAP_HUGETLB; -#if defined(MAP_HUGE_SHIFT) /* Linux-3.8+ */ - mapflag|= my_bit_log2_size_t(large_page_size) << MAP_HUGE_SHIFT; -#else -# warning "No explicit large page (HUGETLB pages) support in Linux < 3.8" -#endif + mapflag|= MAP_HUGETLB | my_bit_log2_size_t(large_page_size) << MAP_HUGE_SHIFT; #elif defined(MAP_ALIGNED) mapflag|= MAP_ALIGNED_SUPER | MAP_ALIGNED(my_bit_log2_size_t(large_page_size)); |