8244847: Linux/PPC: runtime/CompressedOops/CompressedClassPointers: smallHeapTest fails

Reviewed-by: stuefe, mdoerr
This commit is contained in:
Richard Reingruber 2020-12-03 08:50:08 +00:00
parent b44a329f91
commit 4a267f1bc2
2 changed files with 16 additions and 3 deletions

View File

@ -532,7 +532,7 @@ bool Metaspace::class_space_is_initialized() {
// On error, returns an unreserved space.
ReservedSpace Metaspace::reserve_address_space_for_compressed_classes(size_t size) {
#ifdef AARCH64
#if defined(AARCH64) || defined(PPC64)
const size_t alignment = Metaspace::reserve_alignment();
// AArch64: Try to align metaspace so that we can decode a compressed
@ -542,6 +542,13 @@ ReservedSpace Metaspace::reserve_address_space_for_compressed_classes(size_t siz
// of the upper 32-bits of the address are zero so we can handle a shift
// when decoding.
// PPC64: smaller heaps up to 2g will be mapped just below 4g. Then the
// attempt to place the compressed class space just after the heap fails on
// Linux 4.1.42 and higher because the launcher is loaded at 4g
// (ELF_ET_DYN_BASE). In that case we reach here and search the address space
// below 32g to get a zerobased CCS. For simplicity we reuse the search
// strategy for AARCH64.
static const struct {
address from;
address to;
@ -565,7 +572,9 @@ ReservedSpace Metaspace::reserve_address_space_for_compressed_classes(size_t siz
a += search_ranges[i].increment;
}
}
#endif // defined(AARCH64) || defined(PPC64)
#ifdef AARCH64
// Note: on AARCH64, if the code above does not find any good placement, we
// have no recourse. We return an empty space and the VM will exit.
return ReservedSpace();

View File

@ -44,7 +44,7 @@ public class CompressedClassPointers {
// Returns true if we are to test the narrow klass base; we only do this on
// platforms where we can be reasonably shure that we get reproducable placement).
static boolean testNarrowKlassBase() {
if (Platform.isWindows() || Platform.isPPC()) {
if (Platform.isWindows()) {
return false;
}
return true;
@ -98,7 +98,11 @@ public class CompressedClassPointers {
"-Xshare:off",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
if (testNarrowKlassBase()) {
if (testNarrowKlassBase() && !Platform.isAix()) {
// AIX: the heap cannot be placed below 32g. The first attempt to
// place the CCS behind the heap fails (luckily). Subsequently CCS
// is successfully placed below 32g. So we get 0x0 as narrow klass
// base.
output.shouldNotContain("Narrow klass base: 0x0000000000000000");
output.shouldContain("Narrow klass shift: 0");
}