JDK-8137022 : Concurrent refinement thread adjustment and (de-)activation suboptimal
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-09-23
  • Updated: 2024-09-26
  • Resolved: 2022-10-20
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 20
20 b21Fixed
Related Reports
Blocks :  
Blocks :  
CSR :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8295819 :  
Description
After every GC G1 readjusts concurrent refinement thresholds with the goal to have X amount of unprocessed buffers at the start of GC to process in the update RS phase. X is calculated from the time available for the Update RS phase.

The current calculation has the following issues:
- it allows the green threshold to get zero. This means that both refinement threads *and* mutators are competing for the buffers. There is no need to run the threads.
- there are magic factors to create the yellow and red thresholds that have nothing to do with actual application.
- (this may be another issue) activating more refinement threads is not in any way related to the rate they are added to the queue. Ideally more threads would be dynamically activated as the rate the buffers are added to the queue changes


Comments
Changeset: 028e8b3d Author: Kim Barrett <kbarrett@openjdk.org> Date: 2022-10-20 20:29:19 +0000 URL: https://git.openjdk.org/jdk/commit/028e8b3d5e7e1791a9ed0af244f74d21fb12ba81
20-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10256 Date: 2022-09-14 00:36:18 +0000
14-09-2022

This issue from the original description: "- it does not take into account that there is always a set of (typically half-full) buffers attached to the threads at GC start." is really part of JDK-8155996. I'm moving it there.
12-09-2022

This issue from the original description: "- (this may be another issue) mutator-only processing only ever processes its own buffer. This is too little e.g. in case buffers are spilled over from mixed gc." has been moved to JDK-8293616.
10-09-2022

This issue from the original description: "- tries to improve the current (green) threshold by incrementally increasing/decreasing that threshold. The problem is that this multiplication factor basically does nothing at low thresholds" is really part of JDK-8155996. I'm moving it there.
10-09-2022

This item from the original description: "- (this may be another issue) it uses int's instead of size_t's for the thresholds" was fixed a long time ago.
10-09-2022

This item from the original description: "- (this may be another issue) the mutator processing takes the current buffer and processes it. In most cases this is just the wrong decision." was fixed a long time ago by JDK-8139652.
10-09-2022

Another point which may become obsolete with other changes: currently gc creates new refinement buffers for cards to scan to update the remembered sets concurrently. This may be a significant amount of buffers, so a lot of refinement threads are woken up after every gc to (often) essentially shut down immediately as the first few threads clean out that work faster than the threads can wake up. Leading to some kind of throughput issue right after a gc.
10-11-2017