Skip to content

Commit b66c233

Browse files
Use 64k page size by default.
1 parent cb0f826 commit b66c233

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public static void updateMaxJavaStackTraceDepth(EconomicMap<OptionKey<?>, Object
477477
@Option(help = "Color build output ('always', 'never', or 'auto')", type = OptionType.User)//
478478
public static final HostedOptionKey<String> Color = new HostedOptionKey<>("auto");
479479

480-
public static final boolean hasColorsEnabled(OptionValues values) {
480+
public static boolean hasColorsEnabled(OptionValues values) {
481481
if (Color.hasBeenSet(values)) {
482482
String value = Color.getValue(values);
483483
return switch (value) {
@@ -871,6 +871,10 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
871871
maxJavaStackTraceDepth = newValue;
872872
}
873873
};
874+
875+
/** Use {@link SubstrateOptions#getPageSize()} instead. */
876+
@Option(help = "The largest page size of machines that can run the image. The default of 0 automatically selects a typically suitable value.")//
877+
protected static final HostedOptionKey<Integer> PageSize = new HostedOptionKey<>(0);
874878
}
875879

876880
@Option(help = "Overwrites the available number of processors provided by the OS. Any value <= 0 means using the processor count from the OS.")//
@@ -934,14 +938,15 @@ public ReportingSupport(Path reportingPath) {
934938
}
935939
}
936940

937-
@Option(help = "Define PageSize of a machine that runs the image. The default = 0 (== same as host machine page size)")//
938-
protected static final HostedOptionKey<Integer> PageSize = new HostedOptionKey<>(0);
939-
940941
@Fold
941942
public static int getPageSize() {
942-
int value = PageSize.getValue();
943+
int value = ConcealedOptions.PageSize.getValue();
943944
if (value == 0) {
944-
return Unsafe.getUnsafe().pageSize();
945+
/*
946+
* Assume at least a 64k page size if none was specified. This maximizes compatibility
947+
* because images can be executed as long as run-time page size <= build-time page size.
948+
*/
949+
return Math.max(64 * 1024, Unsafe.getUnsafe().pageSize());
945950
}
946951
assert value > 0 : value;
947952
return value;

0 commit comments

Comments
 (0)