JDK-8256287 : [windows] add loop fuse to map_or_reserve_memory_aligned
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-11-12
  • Updated: 2021-05-26
  • Resolved: 2020-11-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 16
11.0.12-oracleFixed 16 b25Fixed
Related Reports
Relates :  
Relates :  
Description
map_or_reserve_memory_aligned attempts to allocate aligned memory by:
1) reserving larger area
2) releasing it
3) attempting to re-reserve into the vacated address space a smaller area at the aligned start address

Since this may fail (between (2) and (3) someone may have grabbed that address concurrently), we do this in a loop. However, when failing to release it we will loop-reserve endlessly.

This is one of the reasons for JDK-8255954 whose root cause will be fixed with JDK-8255978. But we should guard against endless loops independently from that.
Comments
Fix Request 11u: This bug is important to fix since it may cause in rare situations an endless loop. The fix limits the number of iterations in the release loop. It is very simple. Tests: this fix has been tested in SAP 11u builds since three months. The patch does not apply cleanly, but the rewrite is straightforward: Modified patch: http://cr.openjdk.java.net/~stuefe/webrevs/backports/8256287-windows-add-loop-fuse-to-map_or_reserve_memory_aligned-for-11.diff RFR thread: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-December/004304.html
08-03-2021

Changeset: 0357db35 Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2020-11-16 20:08:49 +0000 URL: https://github.com/openjdk/jdk/commit/0357db35
16-11-2020