RFR: 8330076: [NMT] add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v2]

Johan Sjölen jsjolen at openjdk.org
Thu Apr 11 18:08:44 UTC 2024


On Thu, 11 Apr 2024 17:58:37 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/os/bsd/gc/x/xPhysicalMemoryBacking_bsd.cpp line 81:
>> 
>>> 79: 
>>> 80:   // Reserve address space for backing memory
>>> 81:   _base = (uintptr_t)os::reserve_memory(max_capacity, false, mtJavaHeap);
>> 
>> I think this should be using !MemExec and not a raw 'false' argument.
>> 
>> With that said, I really think it would be best if we actually split os::reserve_memory into two distinct functions:
>> 1) os::reserve_memory(max_capacity, mtJavaHeap) // Non-executable memory
>> 2) os::reserve_executable_memory(max_capacity, mtCode) // Executable
>> 
>> Maybe we could think about that in separate RFE.
>
> `false/true` constants are not used in executable args.
> separate reserve_memory functions can be left for another RFE.

The executable argument really is only false in the original, can we keep this from doing any functional changes here and keep that to separate PR:s?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18745#discussion_r1561415984


More information about the shenandoah-dev mailing list