RFR: JDK-8260332: ParallelGC: Cooperative pretouch for oldgen expansion

Amit Pawar github.com+71302734+amitdpawar at openjdk.java.net
Fri Mar 12 20:01:17 UTC 2021


In case of ParallelGC, oldgen expansion can happen during promotion. Expanding thread will touch the pages and can't request for task execution as this GC thread is already executing a task. The expanding thread holds the lock on "ExpandHeap_lock" to resize the oldgen and other threads may wait for their turn. This is a blocking call.

This patch changes this behavior by adding another constructor in "MutexLocker" class to enable non blocking or try_lock operation. This way one thread will acquire the lock and other threads can join pretouch work. Threads failed to acquire the lock will join pretouch only when task is marked ready by expanding thread.

Following minimum expansion size are seen during expansion.
1. 512KB without largepages and without UseNUMA.
2. 64MB without largepages and with UseNUMA,
3. 2MB (on x86)  with large pages and without UseNUMA,
4. 64MB without large pages and with UseNUMA.

When Oldgen is expanding repeatedly with smaller size then this change wont help. For such cases, resize size should adapt to application demand to make use of this change. For example if application nature triggers 100 expansion with smaller sizes in same GC then it is better to increase the expansion size during each resize to reduce the number of resizes. If this patch is accepted then will plan to fix this case in another patch.

Jtreg all test passed.

Please review this change.

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

Commit messages:
 - ParallelGC: Cooperative pretouch for oldgen expansion

Changes: https://git.openjdk.java.net/jdk/pull/2976/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2976&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8260332
  Stats: 185 lines in 9 files changed: 158 ins; 0 del; 27 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2976.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2976/head:pull/2976

PR: https://git.openjdk.java.net/jdk/pull/2976


More information about the hotspot-dev mailing list