JDK-6866330 : G1: clean_up_cache() might not process some cards
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs16
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2009-07-29
  • Updated: 2010-04-04
  • Resolved: 2009-07-29
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.
Other
hs16Resolved
Related Reports
Duplicate :  
Description
When looking at it with John Cuthbertson, we noticed that ConcurrentG1Refine::clean_up_cache() might miss processing some cards. The code looks like this:

  int start_ind = _hot_cache_idx-1;
  for (int i = 0; i < _n_hot; i++) {
    int ind = start_ind - i;
    if (ind < 0) ind = ind + _hot_cache_size;
    jbyte* entry = _hot_cache[ind];
    if (entry != NULL) {
      g1rs->concurrentRefineOneCard(entry, worker_i);
    }
  }

_hot_cache_size is the max size of the cache, _n_hot is how many entries we've added to it and all the entries we need to process are at the bottom of the array [0, _n_hot). But, the above will miss processing [_hot_cache_idx, _n_hot) and instead process (incorrectly) the very top of the array.

Comments
EVALUATION John Cuthbertson's 6865703 will fix this.
29-07-2009

EVALUATION Forgot to add: it's possible that this is one of the sources of the "Missing RSet" bugs we're hitting every now and then.
29-07-2009

SUGGESTED FIX The easy fix is: int start_ind = _hot_cache_idx-1; for (int i = 0; i < _n_hot; i++) { int ind = start_ind - i; - if (ind < 0) ind = ind + _hot_cache_size; + if (ind < 0) ind = ind + _n_hot; jbyte* entry = _hot_cache[ind]; if (entry != NULL) { g1rs->concurrentRefineOneCard(entry, worker_i); } } but John Cuthbertson is actually changing this code as part of 6865703, so he'll make sure the right processing is done in the new version.
29-07-2009

EVALUATION See Description.
29-07-2009