comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp @ 452:00b023ae2d78

6722113: CMS: Incorrect overflow handling during precleaning of Reference lists Summary: When we encounter marking stack overflow during precleaning of Reference lists, we were using the overflow list mechanism, which can cause problems on account of mutating the mark word of the header because of conflicts with mutator accesses and updates of that field. Instead we should use the usual mechanism for overflow handling in concurrent phases, namely dirtying of the card on which the overflowed object lies. Since precleaning effectively does a form of discovered list processing, albeit with discovery enabled, we needed to adjust some code to be correct in the face of interleaved processing and discovery. Reviewed-by: apetrusenko, jcoomes
author ysr
date Thu, 20 Nov 2008 12:27:41 -0800
parents 1ee8caae33af
children e9be0e04635a
comparison
equal deleted inserted replaced
443:b5e603f2e024 452:00b023ae2d78
590 // the current CMS cycle and could lead to stack resizing efforts at 590 // the current CMS cycle and could lead to stack resizing efforts at
591 // an opportune future time. 591 // an opportune future time.
592 size_t _ser_pmc_preclean_ovflw; 592 size_t _ser_pmc_preclean_ovflw;
593 size_t _ser_pmc_remark_ovflw; 593 size_t _ser_pmc_remark_ovflw;
594 size_t _par_pmc_remark_ovflw; 594 size_t _par_pmc_remark_ovflw;
595 size_t _ser_kac_preclean_ovflw;
595 size_t _ser_kac_ovflw; 596 size_t _ser_kac_ovflw;
596 size_t _par_kac_ovflw; 597 size_t _par_kac_ovflw;
597 NOT_PRODUCT(size_t _num_par_pushes;) 598 NOT_PRODUCT(size_t _num_par_pushes;)
598 599
599 // ("Weak") Reference processing support 600 // ("Weak") Reference processing support
1747 1748
1748 // During CMS' weak reference processing, this is a 1749 // During CMS' weak reference processing, this is a
1749 // work-routine/closure used to complete transitive 1750 // work-routine/closure used to complete transitive
1750 // marking of objects as live after a certain point 1751 // marking of objects as live after a certain point
1751 // in which an initial set has been completely accumulated. 1752 // in which an initial set has been completely accumulated.
1753 // This closure is currently used both during the final
1754 // remark stop-world phase, as well as during the concurrent
1755 // precleaning of the discovered reference lists.
1752 class CMSDrainMarkingStackClosure: public VoidClosure { 1756 class CMSDrainMarkingStackClosure: public VoidClosure {
1753 CMSCollector* _collector; 1757 CMSCollector* _collector;
1754 MemRegion _span; 1758 MemRegion _span;
1755 CMSMarkStack* _mark_stack; 1759 CMSMarkStack* _mark_stack;
1756 CMSBitMap* _bit_map; 1760 CMSBitMap* _bit_map;
1757 CMSKeepAliveClosure* _keep_alive; 1761 CMSKeepAliveClosure* _keep_alive;
1762 bool _concurrent_precleaning;
1758 public: 1763 public:
1759 CMSDrainMarkingStackClosure(CMSCollector* collector, MemRegion span, 1764 CMSDrainMarkingStackClosure(CMSCollector* collector, MemRegion span,
1760 CMSBitMap* bit_map, CMSMarkStack* mark_stack, 1765 CMSBitMap* bit_map, CMSMarkStack* mark_stack,
1761 CMSKeepAliveClosure* keep_alive): 1766 CMSKeepAliveClosure* keep_alive,
1767 bool cpc):
1762 _collector(collector), 1768 _collector(collector),
1763 _span(span), 1769 _span(span),
1764 _bit_map(bit_map), 1770 _bit_map(bit_map),
1765 _mark_stack(mark_stack), 1771 _mark_stack(mark_stack),
1766 _keep_alive(keep_alive) { } 1772 _keep_alive(keep_alive),
1773 _concurrent_precleaning(cpc) {
1774 assert(_concurrent_precleaning == _keep_alive->concurrent_precleaning(),
1775 "Mismatch");
1776 }
1767 1777
1768 void do_void(); 1778 void do_void();
1769 }; 1779 };
1770 1780
1771 // A parallel version of CMSDrainMarkingStackClosure above. 1781 // A parallel version of CMSDrainMarkingStackClosure above.