JDK-8333769 : Pretouching tests dont test pretouching
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-06-07
  • Updated: 2024-06-19
  • Resolved: 2024-06-18
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 masterFixed
Related Reports
Relates :  
Relates :  
Description
JDK-8324781 showed that we need a test that makes sure pretouching works. 

The error was caused by a kernel problem with UEK kernels that prevented os::pretouch_memory from working correctly. The only test picking up on that was runtime/Thread/TestAlwaysPreTouchStacks.java. But that's not even its job, all it wants to do is to test the AlwaysPreTouchStacks option.

We have a bunch of AlwaysPreTouch tests (GC specific, and not for every GC, e.g. test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java, test/hotspot/jtreg/gc/x/TestAlwaysPreTouch.java, same for z, and one for Shenandoah.)

All of them do the same: the start the JVM with AlwaysPreTouch, then do nothing. The VM coming up is proof it works. But that is not enough, we should - at least on Linux where this is easily possible - test that we actually pretouch, by observing RSS. Note that TestAlwaysPreTouchStacks.java does that via the inbuilt NMT capability to measure live memory in stacks, that won't work here. We will have to scan /proc/self/status (I think restricting this test to linux for now is fine).

Therefore, I propose:

- start JVMs with Xint, and with a reasonably large heap. E.g. 512MB or 1G. 
- when the VM is up, check RSS. It should be larger than the amount we pretouched.

I think also that these tests could be unified for all GCs, and also ran for Serial, Parallel and G1. 
Comments
Changeset: 8bc2fbe5 Author: Sonia Zaldana Calles <szaldana@openjdk.org> Committer: Thomas Stuefe <stuefe@openjdk.org> Date: 2024-06-18 14:05:11 +0000 URL: https://git.openjdk.org/jdk/commit/8bc2fbe57893b110fdb5fd567df4615e7833e5ae
18-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19699 Date: 2024-06-13 13:24:42 +0000
13-06-2024