Mercurial > hg > truffle
diff src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp @ 889:15c5903cf9e1
6865703: G1: Parallelize hot card cache cleanup
Summary: Have the GC worker threads clear the hot card cache in parallel by having each worker thread claim a chunk of the card cache and process the cards in that chunk. The size of the chunks that each thread will claim is determined at VM initialization from the size of the card cache and the number of worker threads.
Reviewed-by: jmasa, tonyp
author | johnc |
---|---|
date | Mon, 03 Aug 2009 12:59:30 -0700 |
parents | 215f81b4d9b3 |
children | 6cb8e9df7174 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp Sun Aug 02 22:33:27 2009 -0700 +++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp Mon Aug 03 12:59:30 2009 -0700 @@ -36,15 +36,19 @@ size_t _total_cards; size_t _total_travs; - unsigned char* _card_counts; - unsigned _n_card_counts; - const jbyte* _ct_bot; - unsigned* _cur_card_count_histo; - unsigned* _cum_card_count_histo; - jbyte** _hot_cache; - int _hot_cache_size; - int _n_hot; - int _hot_cache_idx; + unsigned char* _card_counts; + unsigned _n_card_counts; + const jbyte* _ct_bot; + unsigned* _cur_card_count_histo; + unsigned* _cum_card_count_histo; + + jbyte** _hot_cache; + int _hot_cache_size; + int _n_hot; + int _hot_cache_idx; + + int _hot_cache_par_chunk_size; + volatile int _hot_cache_par_claimed_idx; // Returns the count of this card after incrementing it. int add_card_count(jbyte* card_ptr); @@ -70,6 +74,11 @@ // Process the cached entries. void clean_up_cache(int worker_i, G1RemSet* g1rs); + // Set up for parallel processing of the cards in the hot cache + void clear_hot_cache_claimed_index() { + _hot_cache_par_claimed_idx = 0; + } + // Discard entries in the hot cache. void clear_hot_cache() { _hot_cache_idx = 0; _n_hot = 0;