diff options
author | Mukul Sabharwal <muks@microsoft.com> | 2019-04-19 14:54:35 -0700 |
---|---|---|
committer | Maoni Stephens <Maoni0@users.noreply.github.com> | 2019-04-19 14:54:35 -0700 |
commit | 4029007b7edd290c236901a246ef48ac3e9de4b6 (patch) | |
tree | a802d2fdcda75744932ee5e4d6f52c46f601275a /src/gc | |
parent | 533564b6f241ee733b30e71ab4f5fbb758c30aad (diff) | |
download | coreclr-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.in | 1 | ||||
-rw-r--r-- | src/gc/unix/configure.cmake | 9 | ||||
-rw-r--r-- | src/gc/unix/gcenv.unix.cpp | 2 |
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 |