src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp

changeset 9046
4edb0f406a2c
parent 8316
626f594dffa6
child 9122
024be04bb151
child 9327
f96fcd9e1e1b
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Mon Oct 23 06:39:54 2017 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp	Mon Feb 24 12:49:21 2014 +0100
     1.3 @@ -514,7 +514,15 @@
     1.4  
     1.5        PerRegionTable* first_prt = _fine_grain_regions[ind];
     1.6        prt->set_collision_list_next(first_prt);
     1.7 -      _fine_grain_regions[ind] = prt;
     1.8 +      // The assignment into _fine_grain_regions allows the prt to
     1.9 +      // start being used concurrently. In addition to
    1.10 +      // collision_list_next which must be visible (else concurrent
    1.11 +      // parsing of the list, if any, may fail to see other entries),
    1.12 +      // the content of the prt must be visible (else for instance
    1.13 +      // some mark bits may not yet seem cleared or a 'later' update
    1.14 +      // performed by a concurrent thread could be undone when the
    1.15 +      // zeroing becomes visible). This requires store ordering.
    1.16 +      OrderAccess::release_store_ptr((volatile PerRegionTable*)&_fine_grain_regions[ind], prt);
    1.17        _n_fine_entries++;
    1.18  
    1.19        if (G1HRRSUseSparseTable) {

mercurial