JDK-8335865 : Shenandoah: Improve THP pretouch after JDK-8315923
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 21,23,24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-08
  • Updated: 2024-08-19
  • Resolved: 2024-08-13
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 24
24 b11Fixed
Related Reports
Relates :  
Relates :  
Description
In Shenandoah pretouching code, we have a kludge for pre-touching heap under THP: https://github.com/openjdk/jdk/blob/c34a1b7013b27a8a214f63387bd528a90342a416/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp#L391-L399

That kludge is counter-productive after JDK-8272807, as JDK-8315923 mentions. The fix for JDK-8315923 enables os::pretouch_memory to use the bulk `madvise`, and it has the fallback for small pages: https://github.com/openjdk/jdk/blob/c34a1b7013b27a8a214f63387bd528a90342a416/src/hotspot/os/linux/os_linux.cpp#L3054-L3070

The Shenandoah code should be reconciled with the improvements brought by JDK-8315923.
Comments
Changeset: 84c3065e Branch: master Author: Neethu Prasad <nprasad@openjdk.org> Committer: Aleksey Shipilev <shade@openjdk.org> Date: 2024-08-13 17:22:41 +0000 URL: https://git.openjdk.org/jdk/commit/84c3065e8004122f3455a8c28c8719b2c8111c17
13-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20254 Date: 2024-07-19 14:28:24 +0000
22-07-2024