--- a/hotspot/src/os/linux/vm/os_linux.cpp Thu Oct 03 21:36:29 2013 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp Sat Oct 05 10:14:58 2013 +0200
@@ -3361,13 +3361,15 @@
if (FLAG_IS_DEFAULT(UseHugeTLBFS) &&
FLAG_IS_DEFAULT(UseSHM) &&
FLAG_IS_DEFAULT(UseTransparentHugePages)) {
- // If UseLargePages is specified on the command line try all methods,
- // if it's default, then try only UseTransparentHugePages.
- if (FLAG_IS_DEFAULT(UseLargePages)) {
- UseTransparentHugePages = true;
- } else {
- UseHugeTLBFS = UseTransparentHugePages = UseSHM = true;
- }
+
+ // The type of large pages has not been specified by the user.
+
+ // Try UseHugeTLBFS and then UseSHM.
+ UseHugeTLBFS = UseSHM = true;
+
+ // Don't try UseTransparentHugePages since there are known
+ // performance issues with it turned on. This might change in the future.
+ UseTransparentHugePages = false;
}
if (UseTransparentHugePages) {
@@ -3393,9 +3395,19 @@
}
void os::large_page_init() {
- if (!UseLargePages) {
+ if (!UseLargePages &&
+ !UseTransparentHugePages &&
+ !UseHugeTLBFS &&
+ !UseSHM) {
+ // Not using large pages.
+ return;
+ }
+
+ if (!FLAG_IS_DEFAULT(UseLargePages) && !UseLargePages) {
+ // The user explicitly turned off large pages.
+ // Ignore the rest of the large pages flags.
+ UseTransparentHugePages = false;
UseHugeTLBFS = false;
- UseTransparentHugePages = false;
UseSHM = false;
return;
}