RFR: JDK-8322943: runtime/CompressedOops/CompressedClassPointers.java fails on AIX [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Feb 27 06:00:48 UTC 2024


On Mon, 26 Feb 2024 15:39:45 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:

> I don't think a local test fix makes sense. After all it is a real issue that os::attempt_reserve_memory_between() is using 4K alignment when we try to allocate 256M shmat memory. We could do a temporary #ifdef AIX solution in that function.

That is a good point. And a good compromise.

@JoKern65 can you try this:


diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index 5d6c1fa69ca..34a708e1cdc 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -1892,7 +1892,15 @@ char* os::attempt_reserve_memory_between(char* min, char* max, size_t bytes, siz
   char* const absolute_max = (char*)(NOT_LP64(G * 3) LP64_ONLY(G * 128 * 1024));
   char* const absolute_min = (char*) os::vm_min_address();
 
-  const size_t alignment_adjusted = MAX2(alignment, os::vm_allocation_granularity());
+  const size_t system_allocation_granularity =
+#ifdef AIX
+  // AIX is the only platform that uses System V shm for reserving virtual memory. As long as we
+  // have not fixed os::vm_allocation_granularity(), hard-code allocation granularity of SHMLBA here.
+      SHMLBA;
+#else
+      os::vm_allocation_granularity();
+#endif
+  const size_t alignment_adjusted = MAX2(alignment, system_allocation_granularity);

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17708#issuecomment-1965841801


More information about the hotspot-runtime-dev mailing list