comparison 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
comparison
equal deleted inserted replaced
888:59726d16b30d 889:15c5903cf9e1
34 bool _def_use_cache; 34 bool _def_use_cache;
35 size_t _n_periods; 35 size_t _n_periods;
36 size_t _total_cards; 36 size_t _total_cards;
37 size_t _total_travs; 37 size_t _total_travs;
38 38
39 unsigned char* _card_counts; 39 unsigned char* _card_counts;
40 unsigned _n_card_counts; 40 unsigned _n_card_counts;
41 const jbyte* _ct_bot; 41 const jbyte* _ct_bot;
42 unsigned* _cur_card_count_histo; 42 unsigned* _cur_card_count_histo;
43 unsigned* _cum_card_count_histo; 43 unsigned* _cum_card_count_histo;
44 jbyte** _hot_cache; 44
45 int _hot_cache_size; 45 jbyte** _hot_cache;
46 int _n_hot; 46 int _hot_cache_size;
47 int _hot_cache_idx; 47 int _n_hot;
48 int _hot_cache_idx;
49
50 int _hot_cache_par_chunk_size;
51 volatile int _hot_cache_par_claimed_idx;
48 52
49 // Returns the count of this card after incrementing it. 53 // Returns the count of this card after incrementing it.
50 int add_card_count(jbyte* card_ptr); 54 int add_card_count(jbyte* card_ptr);
51 55
52 void print_card_count_histo_range(unsigned* histo, int from, int to, 56 void print_card_count_histo_range(unsigned* histo, int from, int to,
68 jbyte* cache_insert(jbyte* card_ptr); 72 jbyte* cache_insert(jbyte* card_ptr);
69 73
70 // Process the cached entries. 74 // Process the cached entries.
71 void clean_up_cache(int worker_i, G1RemSet* g1rs); 75 void clean_up_cache(int worker_i, G1RemSet* g1rs);
72 76
77 // Set up for parallel processing of the cards in the hot cache
78 void clear_hot_cache_claimed_index() {
79 _hot_cache_par_claimed_idx = 0;
80 }
81
73 // Discard entries in the hot cache. 82 // Discard entries in the hot cache.
74 void clear_hot_cache() { 83 void clear_hot_cache() {
75 _hot_cache_idx = 0; _n_hot = 0; 84 _hot_cache_idx = 0; _n_hot = 0;
76 } 85 }
77 86