RFR: 8134540: Much nearly duplicated code for PerfMemory support [v2]

Harold Seigel hseigel at openjdk.java.net
Fri Jan 15 18:46:11 UTC 2021


On Fri, 15 Jan 2021 14:40:26 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8134540: changes for review comments
>
> src/hotspot/os/posix/perfMemory_posix.cpp line 1040:
> 
>> 1038:     warning("perfmemory: munmap failed (%d)\n", errno);
>> 1039:   }
>> 1040: #else
> 
> - I think the AIX specific path would be more correct for all other implementations too. Since on creation, we call raw ::mmap(). Then we should call raw ::munmap here too. Otherwise this relies on the fact that os::reserve_memory always uses mmap(), which is not given.
> - Strictly speaking this needs a release from MemTracker if it does not go thru os::release_memory. But I think its not important, this mapping only goes away when the VM exits, no? At least on AIX no-one ever noticed anything.

As you point out, the problem with the AIX specific path is that it doesn't call MemTracker.  I think this is an area that should be cleaned up through a separate RFE.

> src/hotspot/os/posix/perfMemory_posix.cpp line 1213:
> 
>> 1211: #if defined(_AIX)
>> 1212:   MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC, mtInternal);
>> 1213: #else
> 
> As above, the generic path should be fine for AIX too.

done

> src/hotspot/os/posix/perfMemory_posix.cpp line 889:
> 
>> 887:   }
>> 888: 
>> 889: #if !defined(_AIX)
> 
> Please enable this for AIX too. Seems we just missed "JDK-7007769: VM crashes with SIGBUS writing PerfData if tmp space is full" (I think AIX port was not official then)

done

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

PR: https://git.openjdk.java.net/jdk/pull/2037


More information about the hotspot-runtime-dev mailing list