Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20504:6948da6d7c13
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
Summary: Remove -XX:-G1DeferredRSUpdate functionality as it is racy. During evacuation failure handling, threads where evacuation failure handling occurred may try to add remembered sets to regions which remembered sets are currently being scanned. The iterator to handle the remembered set scan does not support addition of entries during scan and so may skip valid references.
Reviewed-by: iveresov, brutisso, mgerdin
author | tschatzl |
---|---|
date | Tue, 30 Sep 2014 09:44:36 +0200 |
parents | fa56205f142c |
children | d3fd73295885 |
comparison
equal
deleted
inserted
replaced
20503:fa56205f142c | 20504:6948da6d7c13 |
---|---|
1481 ParallelTaskTerminator::print_termination_counts(); | 1481 ParallelTaskTerminator::print_termination_counts(); |
1482 #endif | 1482 #endif |
1483 | 1483 |
1484 // Discard all rset updates | 1484 // Discard all rset updates |
1485 JavaThread::dirty_card_queue_set().abandon_logs(); | 1485 JavaThread::dirty_card_queue_set().abandon_logs(); |
1486 assert(!G1DeferredRSUpdate | 1486 assert(dirty_card_queue_set().completed_buffers_num() == 0, "DCQS should be empty"); |
1487 || (G1DeferredRSUpdate && | |
1488 (dirty_card_queue_set().completed_buffers_num() == 0)), "Should not be any"); | |
1489 | 1487 |
1490 _young_list->reset_sampled_info(); | 1488 _young_list->reset_sampled_info(); |
1491 // At this point there should be no regions in the | 1489 // At this point there should be no regions in the |
1492 // entire heap tagged as young. | 1490 // entire heap tagged as young. |
1493 assert(check_young_list_empty(true /* check_heap */), | 1491 assert(check_young_list_empty(true /* check_heap */), |
2098 DirtyCardQ_FL_lock, | 2096 DirtyCardQ_FL_lock, |
2099 concurrent_g1_refine()->yellow_zone(), | 2097 concurrent_g1_refine()->yellow_zone(), |
2100 concurrent_g1_refine()->red_zone(), | 2098 concurrent_g1_refine()->red_zone(), |
2101 Shared_DirtyCardQ_lock); | 2099 Shared_DirtyCardQ_lock); |
2102 | 2100 |
2103 if (G1DeferredRSUpdate) { | 2101 dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code |
2104 dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code | 2102 DirtyCardQ_CBL_mon, |
2105 DirtyCardQ_CBL_mon, | 2103 DirtyCardQ_FL_lock, |
2106 DirtyCardQ_FL_lock, | 2104 -1, // never trigger processing |
2107 -1, // never trigger processing | 2105 -1, // no limit on length |
2108 -1, // no limit on length | 2106 Shared_DirtyCardQ_lock, |
2109 Shared_DirtyCardQ_lock, | 2107 &JavaThread::dirty_card_queue_set()); |
2110 &JavaThread::dirty_card_queue_set()); | |
2111 } | |
2112 | 2108 |
2113 // Initialize the card queue set used to hold cards containing | 2109 // Initialize the card queue set used to hold cards containing |
2114 // references into the collection set. | 2110 // references into the collection set. |
2115 _into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code | 2111 _into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code |
2116 DirtyCardQ_CBL_mon, | 2112 DirtyCardQ_CBL_mon, |
5301 timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed()); | 5297 timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed()); |
5302 } | 5298 } |
5303 }; | 5299 }; |
5304 | 5300 |
5305 void G1CollectedHeap::redirty_logged_cards() { | 5301 void G1CollectedHeap::redirty_logged_cards() { |
5306 guarantee(G1DeferredRSUpdate, "Must only be called when using deferred RS updates."); | |
5307 double redirty_logged_cards_start = os::elapsedTime(); | 5302 double redirty_logged_cards_start = os::elapsedTime(); |
5308 | 5303 |
5309 uint n_workers = (G1CollectedHeap::use_parallel_gc_threads() ? | 5304 uint n_workers = (G1CollectedHeap::use_parallel_gc_threads() ? |
5310 _g1h->workers()->active_workers() : 1); | 5305 _g1h->workers()->active_workers() : 1); |
5311 | 5306 |
5961 // will log these updates (and dirty their associated | 5956 // will log these updates (and dirty their associated |
5962 // cards). We need these updates logged to update any | 5957 // cards). We need these updates logged to update any |
5963 // RSets. | 5958 // RSets. |
5964 enqueue_discovered_references(n_workers); | 5959 enqueue_discovered_references(n_workers); |
5965 | 5960 |
5966 if (G1DeferredRSUpdate) { | 5961 redirty_logged_cards(); |
5967 redirty_logged_cards(); | |
5968 } | |
5969 COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); | 5962 COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); |
5970 } | 5963 } |
5971 | 5964 |
5972 void G1CollectedHeap::free_region(HeapRegion* hr, | 5965 void G1CollectedHeap::free_region(HeapRegion* hr, |
5973 FreeRegionList* free_list, | 5966 FreeRegionList* free_list, |