From 34f4fb6411e13f0dff94a8ffd7f90d08bb91d907 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 1 Dec 2017 01:56:02 +0000 Subject: Add support for "-XX:+UseLargePages" option. Excerpted from the original submission: "FreeBSD on several architectures automatically utilizes superpages. So, for the JVM's JIT-compiled code cache and data heap, much of those regions are already using superpages. However, the -XX:+UseLargePages option still serves a useful, if secondary, purpose on FreeBSD. Essentially, it informs the JVM's platform-independent layer what the supported page sizes are. So, when memory is mmap(2)ed and munmap(2)ed within the code cache and data heap, the addresses and sizes will be superpage-aligned and a multiple of the superpage size, respectively. Currently, without this patch, the code cache, for example, typically starts at an unaligned address, so the initial portion of the code cache can never be a superpage. Similarly, unaligned munmap(2)s on the data heap force the kernel to demote superpages to 4KB pages, and this patch eliminates those demotions. This patch both introduces the code needed on FreeBSD to implement -XX:+UseLargePages and deletes code that was copied from Linux that is, to the best of my knowledge, useless on any version of BSD, i.e., UseHugeTLBFS and UseSHM. The additions are in part based on the Solaris version of os_solaris.cpp, e.g., the sorting of the page sizes array." Note I did minor style cleanup and regenerated the patches. Submitted by: alc --- .../files/patch-hotspot_src_share_vm_runtime_arguments.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 java/openjdk8/files/patch-hotspot_src_share_vm_runtime_arguments.cpp (limited to 'java/openjdk8/files/patch-hotspot_src_share_vm_runtime_arguments.cpp') diff --git a/java/openjdk8/files/patch-hotspot_src_share_vm_runtime_arguments.cpp b/java/openjdk8/files/patch-hotspot_src_share_vm_runtime_arguments.cpp new file mode 100644 index 000000000000..a437f8fccb42 --- /dev/null +++ b/java/openjdk8/files/patch-hotspot_src_share_vm_runtime_arguments.cpp @@ -0,0 +1,12 @@ +--- hotspot/src/share/vm/runtime/arguments.cpp.orig 2017-12-01 00:32:02.284351000 +0000 ++++ hotspot/src/share/vm/runtime/arguments.cpp 2017-12-01 00:38:48.362549000 +0000 +@@ -3974,7 +3974,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) { + hotspotrc, hotspotrc); + } + +-#ifdef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. ++#if defined(_ALLBSD_SOURCE) && !defined(__FreeBSD__) ++ // UseLargePages is not yet supported on BSD. + UNSUPPORTED_OPTION(UseLargePages, "-XX:+UseLargePages"); + #endif + -- cgit v1.2.3