Wed, 04 Nov 2015 13:38:38 +0100
8138966: Intermittent SEGV running ParallelGC
Summary: Add necessary memory fences so that the parallel threads are unable to observe partially filled block tables.
Reviewed-by: tschatzl
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Fri Jun 12 16:09:45 2015 +0100 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Wed Nov 04 13:38:38 2015 +0100 1.3 @@ -348,7 +348,7 @@ 1.4 HeapWord* _partial_obj_addr; 1.5 region_sz_t _partial_obj_size; 1.6 region_sz_t volatile _dc_and_los; 1.7 - bool _blocks_filled; 1.8 + bool volatile _blocks_filled; 1.9 1.10 #ifdef ASSERT 1.11 size_t _blocks_filled_count; // Number of block table fills. 1.12 @@ -499,7 +499,9 @@ 1.13 inline bool 1.14 ParallelCompactData::RegionData::blocks_filled() const 1.15 { 1.16 - return _blocks_filled; 1.17 + bool result = _blocks_filled; 1.18 + OrderAccess::acquire(); 1.19 + return result; 1.20 } 1.21 1.22 #ifdef ASSERT 1.23 @@ -513,6 +515,7 @@ 1.24 inline void 1.25 ParallelCompactData::RegionData::set_blocks_filled() 1.26 { 1.27 + OrderAccess::release(); 1.28 _blocks_filled = true; 1.29 // Debug builds count the number of times the table was filled. 1.30 DEBUG_ONLY(Atomic::inc_ptr(&_blocks_filled_count));