RFR: JDK-8322943: runtime/CompressedOops/CompressedClassPointers.java fails on AIX [v2]
Thomas Stuefe
stuefe at openjdk.org
Tue Feb 27 07:32:46 UTC 2024
On Tue, 27 Feb 2024 07:07:08 GMT, Joachim Kern <jkern 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);
> > ```
>
> Yes, I will try that, but one question. Is the following code snipit an example for the incorrect use of vm_allocation_granularity or did I understand something wrong?
>
> ```
> ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, size_t page_size,
> bool special, bool executable) : _fd_for_heap(-1) {
> assert((size % os::vm_allocation_granularity()) == 0,
> "size not allocation aligned");
> initialize_members(base, size, alignment, page_size, special, executable);
> }
> ```
I think so, yes.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17708#issuecomment-1965942121
More information about the hotspot-runtime-dev
mailing list