Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @ 17754:d7070f371770
8035815: Cache-align and pad the from card cache
Summary: The from card cache is a very frequently accessed data structure. It is essentially a 2d array of per-region values, one row of values for every GC thread. Pad and align the data structure to avoid false sharing.
Reviewed-by: stefank
author | tschatzl |
---|---|
date | Mon, 24 Mar 2014 15:30:30 +0100 |
parents | 191174b49bec |
children | ae7336d6337e |
comparison
equal
deleted
inserted
replaced
17753:191174b49bec | 17754:d7070f371770 |
---|---|
119 // false. | 119 // false. |
120 bool del_single_region_table(size_t ind, HeapRegion* hr); | 120 bool del_single_region_table(size_t ind, HeapRegion* hr); |
121 | 121 |
122 // Indexed by thread X heap region, to minimize thread contention. | 122 // Indexed by thread X heap region, to minimize thread contention. |
123 static int** _from_card_cache; | 123 static int** _from_card_cache; |
124 static size_t _from_card_cache_max_regions; | 124 static uint _from_card_cache_max_regions; |
125 static size_t _from_card_cache_mem_size; | 125 static size_t _from_card_cache_mem_size; |
126 | 126 |
127 // link/add the given fine grain remembered set into the "all" list | 127 // link/add the given fine grain remembered set into the "all" list |
128 void link_to_all(PerRegionTable * prt); | 128 void link_to_all(PerRegionTable * prt); |
129 // unlink/remove the given fine grain remembered set into the "all" list | 129 // unlink/remove the given fine grain remembered set into the "all" list |
168 | 168 |
169 void do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task); | 169 void do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task); |
170 | 170 |
171 // Declare the heap size (in # of regions) to the OtherRegionsTable. | 171 // Declare the heap size (in # of regions) to the OtherRegionsTable. |
172 // (Uses it to initialize from_card_cache). | 172 // (Uses it to initialize from_card_cache). |
173 static void init_from_card_cache(size_t max_regions); | 173 static void init_from_card_cache(uint max_regions); |
174 | 174 |
175 // Declares that only regions i s.t. 0 <= i < new_n_regs are in use. | 175 // Declares that only regions i s.t. 0 <= i < new_n_regs are in use. |
176 // Make sure any entries for higher regions are invalid. | 176 // Make sure any entries for higher regions are invalid. |
177 static void shrink_from_card_cache(size_t new_n_regs); | 177 static void shrink_from_card_cache(uint new_n_regs); |
178 | 178 |
179 static void print_from_card_cache(); | 179 static void print_from_card_cache(); |
180 }; | 180 }; |
181 | 181 |
182 class HeapRegionRemSet : public CHeapObj<mtGC> { | 182 class HeapRegionRemSet : public CHeapObj<mtGC> { |
220 static void print_event(outputStream* str, Event evnt); | 220 static void print_event(outputStream* str, Event evnt); |
221 | 221 |
222 public: | 222 public: |
223 HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); | 223 HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); |
224 | 224 |
225 static int num_par_rem_sets(); | 225 static uint num_par_rem_sets(); |
226 static void setup_remset_size(); | 226 static void setup_remset_size(); |
227 | 227 |
228 HeapRegion* hr() const { | 228 HeapRegion* hr() const { |
229 return _other_regions.hr(); | 229 return _other_regions.hr(); |
230 } | 230 } |
356 | 356 |
357 // Declare the heap size (in # of regions) to the HeapRegionRemSet(s). | 357 // Declare the heap size (in # of regions) to the HeapRegionRemSet(s). |
358 // (Uses it to initialize from_card_cache). | 358 // (Uses it to initialize from_card_cache). |
359 static void init_heap(uint max_regions) { | 359 static void init_heap(uint max_regions) { |
360 G1CodeRootSet::initialize(); | 360 G1CodeRootSet::initialize(); |
361 OtherRegionsTable::init_from_card_cache((size_t) max_regions); | 361 OtherRegionsTable::init_from_card_cache(max_regions); |
362 } | 362 } |
363 | 363 |
364 // Declares that only regions i s.t. 0 <= i < new_n_regs are in use. | 364 // Declares that only regions i s.t. 0 <= i < new_n_regs are in use. |
365 static void shrink_heap(uint new_n_regs) { | 365 static void shrink_heap(uint new_n_regs) { |
366 OtherRegionsTable::shrink_from_card_cache((size_t) new_n_regs); | 366 OtherRegionsTable::shrink_from_card_cache(new_n_regs); |
367 } | 367 } |
368 | 368 |
369 #ifndef PRODUCT | 369 #ifndef PRODUCT |
370 static void print_from_card_cache() { | 370 static void print_from_card_cache() { |
371 OtherRegionsTable::print_from_card_cache(); | 371 OtherRegionsTable::print_from_card_cache(); |