[jdk21u-dev] RFR: 8313319: [linux] mmap should use MAP_FIXED_NOREPLACE if available [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Nov 18 16:01:40 UTC 2025


On Mon, 17 Nov 2025 12:50:54 GMT, Sergey Chernyshev <schernyshev at openjdk.org> wrote:

>> Hi all,
>> 
>> Please review the backport of JDK-8313319 that prevents unnecessary mmap-munmap cycle in systems that do not honor the address hint when mmapping memory without MAP_FIXED. Please see more details in #2475. ~~This is (almost) a clean backport, with only a minor context conflict due to JDK-8315923 hasn't been backported to JDK 21.~~
>> 
>> UPD: Apart from a minor context issue related to JDK-8315923, there was a second definition of MAP_FIXED_NOREPLACE, introduced by [JDK-8330520](https://github.com/openjdk/jdk21u/commit/fee209491beb07c09119a81c78d86d455c79c58b) backport.
>> 
>> Testing:
>> 
>> - jtreg standard test groups passed
>> - gtests passed (aarch64 & amd64)
>
> Sergey Chernyshev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix the double definition that came from 8330520

Patch is okay.

Hmm

> Hi Thomas, thanks four your note! Yes, this backport is performance only. I haven't seen other problems of randmmap-patched kernel except for one with ZGC.
> 
> UPD. I missed the double definition of MAP_FIXED_NOREPLACE that came from JDK-8330520.

Hmm. Something must have gone wrong with the backport of JDK-8330520. It took parts of 8313319 with it, it seems.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk21u-dev/pull/2476#pullrequestreview-3478535661
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/2476#issuecomment-3548347494


More information about the jdk-updates-dev mailing list