Mercurial > hg > truffle
annotate test/runtime/memory/LargePages/TestLargePagesFlags.java @ 15333:06ecedffb109
Use LIRGeneratorTool in Backend.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 23 Apr 2014 11:32:47 +0200 |
parents | 263f2c796d6c |
children |
rev | line source |
---|---|
12832
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
1 /* |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
4 * |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
8 * |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
13 * accompanied this code). |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
14 * |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
18 * |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
21 * questions. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
22 */ |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
23 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
24 /* @test TestLargePagesFlags |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
25 * @summary Tests how large pages are choosen depending on the given large pages flag combinations. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
26 * @library /testlibrary |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
27 * @run main TestLargePagesFlags |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
28 */ |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
29 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
30 import com.oracle.java.testlibrary.OutputAnalyzer; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
31 import com.oracle.java.testlibrary.Platform; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
32 import com.oracle.java.testlibrary.ProcessTools; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
33 import java.util.ArrayList; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
34 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
35 public class TestLargePagesFlags { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
36 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
37 public static void main(String [] args) throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
38 if (!Platform.isLinux()) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
39 System.out.println("Skipping. TestLargePagesFlags has only been implemented for Linux."); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
40 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
41 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
42 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
43 testUseTransparentHugePages(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
44 testUseHugeTLBFS(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
45 testUseSHM(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
46 testCombinations(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
47 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
48 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
49 public static void testUseTransparentHugePages() throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
50 if (!canUse(UseTransparentHugePages(true))) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
51 System.out.println("Skipping testUseTransparentHugePages"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
52 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
53 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
54 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
55 // -XX:-UseLargePages overrides all other flags. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
56 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
57 .use(UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
58 UseTransparentHugePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
59 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
60 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
61 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
62 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
63 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
64 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
65 // Explicitly turn on UseTransparentHugePages. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
66 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
67 .use(UseTransparentHugePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
68 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
69 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
70 UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
71 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
72 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
73 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
74 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
75 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
76 UseTransparentHugePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
77 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
78 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
79 UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
80 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
81 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
82 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
83 // Setting a specific large pages flag will turn |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
84 // off heuristics to choose large pages type. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
85 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
86 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
87 UseTransparentHugePages(false)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
88 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
89 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
90 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
91 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
92 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
93 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
94 // Don't turn on UseTransparentHugePages |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
95 // unless the user explicitly asks for them. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
96 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
97 .use(UseLargePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
98 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
99 UseTransparentHugePages(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
100 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
101 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
102 public static void testUseHugeTLBFS() throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
103 if (!canUse(UseHugeTLBFS(true))) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
104 System.out.println("Skipping testUseHugeTLBFS"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
105 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
106 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
107 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
108 // -XX:-UseLargePages overrides all other flags. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
109 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
110 .use(UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
111 UseHugeTLBFS(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
112 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
113 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
114 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
115 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
116 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
117 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
118 // Explicitly turn on UseHugeTLBFS. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
119 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
120 .use(UseHugeTLBFS(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
121 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
122 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
123 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
124 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
125 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
126 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
127 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
128 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
129 UseHugeTLBFS(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
130 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
131 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
132 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
133 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
134 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
135 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
136 // Setting a specific large pages flag will turn |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
137 // off heuristics to choose large pages type. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
138 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
139 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
140 UseHugeTLBFS(false)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
141 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
142 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
143 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
144 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
145 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
146 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
147 // Using UseLargePages will default to UseHugeTLBFS large pages. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
148 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
149 .use(UseLargePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
150 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
151 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
152 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
153 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
154 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
155 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
156 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
157 public static void testUseSHM() throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
158 if (!canUse(UseSHM(true))) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
159 System.out.println("Skipping testUseSHM"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
160 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
161 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
162 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
163 // -XX:-UseLargePages overrides all other flags. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
164 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
165 .use(UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
166 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
167 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
168 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
169 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
170 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
171 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
172 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
173 // Explicitly turn on UseSHM. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
174 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
175 .use(UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
176 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
177 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
178 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
179 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
180 UseSHM(true)) ; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
181 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
182 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
183 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
184 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
185 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
186 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
187 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
188 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
189 UseSHM(true)) ; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
190 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
191 // Setting a specific large pages flag will turn |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
192 // off heuristics to choose large pages type. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
193 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
194 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
195 UseSHM(false)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
196 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
197 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
198 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
199 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
200 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
201 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
202 // Setting UseLargePages can allow the system to choose |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
203 // UseHugeTLBFS instead of UseSHM, but never UseTransparentHugePages. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
204 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
205 .use(UseLargePages(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
206 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
207 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
208 UseTransparentHugePages(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
209 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
210 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
211 public static void testCombinations() throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
212 if (!canUse(UseSHM(true)) || !canUse(UseHugeTLBFS(true))) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
213 System.out.println("Skipping testUseHugeTLBFSAndUseSHMCombination"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
214 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
215 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
216 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
217 // UseHugeTLBFS takes precedence over SHM. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
218 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
219 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
220 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
221 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
222 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
223 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
224 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
225 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
226 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
227 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
228 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
229 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
230 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
231 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
232 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
233 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
234 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
235 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
236 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
237 UseSHM(true)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
238 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
239 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
240 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
241 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
242 UseSHM(false)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
243 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
244 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
245 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
246 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
247 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
248 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
249 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
250 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
251 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
252 UseSHM(false)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
253 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
254 UseLargePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
255 UseTransparentHugePages(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
256 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
257 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
258 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
259 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
260 if (!canUse(UseTransparentHugePages(true))) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
261 return; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
262 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
263 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
264 // UseTransparentHugePages takes precedence. |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
265 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
266 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
267 .use(UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
268 UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
269 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
270 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
271 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
272 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
273 UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
274 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
275 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
276 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
277 new FlagTester() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
278 .use(UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
279 UseHugeTLBFS(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
280 UseSHM(true)) |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
281 .expect( |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
282 UseLargePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
283 UseTransparentHugePages(true), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
284 UseHugeTLBFS(false), |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
285 UseSHM(false)); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
286 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
287 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
288 private static class FlagTester { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
289 private Flag [] useFlags; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
290 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
291 public FlagTester use(Flag... useFlags) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
292 this.useFlags = useFlags; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
293 return this; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
294 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
295 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
296 public void expect(Flag... expectedFlags) throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
297 if (useFlags == null) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
298 throw new IllegalStateException("Must run use() before expect()"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
299 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
300 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
301 OutputAnalyzer output = executeNewJVM(useFlags); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
302 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
303 for (Flag flag : expectedFlags) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
304 System.out.println("Looking for: " + flag.flagString()); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
305 String strValue = output.firstMatch(".* " + flag.name() + " .* :?= (\\S+).*", 1); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
306 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
307 if (strValue == null) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
308 throw new RuntimeException("Flag " + flag.name() + " couldn't be found"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
309 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
310 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
311 if (!flag.value().equals(strValue)) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
312 throw new RuntimeException("Wrong value for: " + flag.name() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
313 + " expected: " + flag.value() |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
314 + " got: " + strValue); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
315 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
316 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
317 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
318 output.shouldHaveExitValue(0); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
319 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
320 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
321 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
322 private static OutputAnalyzer executeNewJVM(Flag... flags) throws Exception { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
323 ArrayList<String> args = new ArrayList<>(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
324 for (Flag flag : flags) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
325 args.add(flag.flagString()); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
326 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
327 args.add("-XX:+PrintFlagsFinal"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
328 args.add("-version"); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
329 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
330 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
331 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
332 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
333 return output; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
334 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
335 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
336 private static boolean canUse(Flag flag) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
337 try { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
338 new FlagTester().use(flag).expect(flag); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
339 } catch (Exception e) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
340 return false; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
341 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
342 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
343 return true; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
344 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
345 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
346 private static Flag UseLargePages(boolean value) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
347 return new BooleanFlag("UseLargePages", value); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
348 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
349 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
350 private static Flag UseTransparentHugePages(boolean value) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
351 return new BooleanFlag("UseTransparentHugePages", value); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
352 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
353 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
354 private static Flag UseHugeTLBFS(boolean value) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
355 return new BooleanFlag("UseHugeTLBFS", value); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
356 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
357 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
358 private static Flag UseSHM(boolean value) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
359 return new BooleanFlag("UseSHM", value); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
360 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
361 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
362 private static class BooleanFlag implements Flag { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
363 private String name; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
364 private boolean value; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
365 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
366 BooleanFlag(String name, boolean value) { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
367 this.name = name; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
368 this.value = value; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
369 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
370 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
371 public String flagString() { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
372 return "-XX:" + (value ? "+" : "-") + name; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
373 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
374 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
375 public String name() { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
376 return name; |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
377 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
378 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
379 public String value() { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
380 return Boolean.toString(value); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
381 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
382 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
383 |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
384 private static interface Flag { |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
385 public String flagString(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
386 public String name(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
387 public String value(); |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
388 } |
263f2c796d6c
8024838: Significant slowdown due to transparent huge pages
stefank
parents:
diff
changeset
|
389 } |