Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/hotspot/share/memory/metaspace.cpp
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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();
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -98,7 +98,11 @@ public static void largeHeapTest() throws Exception {
"-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");
}
Expand Down