summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
authorMukul Sabharwal <muks@microsoft.com>2019-04-19 14:54:35 -0700
committerMaoni Stephens <Maoni0@users.noreply.github.com>2019-04-19 14:54:35 -0700
commit4029007b7edd290c236901a246ef48ac3e9de4b6 (patch)
treea802d2fdcda75744932ee5e4d6f52c46f601275a /src/gc
parent533564b6f241ee733b30e71ab4f5fbb758c30aad (diff)
downloadcoreclr-4029007b7edd290c236901a246ef48ac3e9de4b6.tar.gz
coreclr-4029007b7edd290c236901a246ef48ac3e9de4b6.tar.bz2
coreclr-4029007b7edd290c236901a246ef48ac3e9de4b6.zip
Large Pages on Linux & macOS (#24098)
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/unix/config.h.in1
-rw-r--r--src/gc/unix/configure.cmake9
-rw-r--r--src/gc/unix/gcenv.unix.cpp2
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gc/unix/config.h.in b/src/gc/unix/config.h.in
index 99866cdadc..7f4d8d766c 100644
--- a/src/gc/unix/config.h.in
+++ b/src/gc/unix/config.h.in
@@ -9,6 +9,7 @@
#cmakedefine01 HAVE_SYS_MMAN_H
#cmakedefine01 HAVE_PTHREAD_THREADID_NP
#cmakedefine01 HAVE_PTHREAD_GETTHREADID_NP
+#cmakedefine01 HAVE_VM_FLAGS_SUPERPAGE_SIZE_ANY
#cmakedefine01 HAVE_MAP_HUGETLB
#cmakedefine01 HAVE_SCHED_GETCPU
#cmakedefine01 HAVE_NUMA_H
diff --git a/src/gc/unix/configure.cmake b/src/gc/unix/configure.cmake
index 2e31766612..3e478c4e6b 100644
--- a/src/gc/unix/configure.cmake
+++ b/src/gc/unix/configure.cmake
@@ -29,6 +29,15 @@ check_cxx_source_compiles("
int main()
{
+ return VM_FLAGS_SUPERPAGE_SIZE_ANY;
+ }
+ " HAVE_VM_FLAGS_SUPERPAGE_SIZE_ANY)
+
+check_cxx_source_compiles("
+ #include <sys/mman.h>
+
+ int main()
+ {
return MAP_HUGETLB;
}
" HAVE_MAP_HUGETLB)
diff --git a/src/gc/unix/gcenv.unix.cpp b/src/gc/unix/gcenv.unix.cpp
index edddee16ce..c248082c95 100644
--- a/src/gc/unix/gcenv.unix.cpp
+++ b/src/gc/unix/gcenv.unix.cpp
@@ -551,6 +551,8 @@ void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size)
{
#if HAVE_MAP_HUGETLB
uint32_t largePagesFlag = MAP_HUGETLB;
+#elif HAVE_VM_FLAGS_SUPERPAGE_SIZE_ANY
+ uint32_t largePagesFlag = VM_FLAGS_SUPERPAGE_SIZE_ANY;
#else
uint32_t largePagesFlag = 0;
#endif