8053998: Hot card cache flush chunk size too coarse grained
authormlarsson
Thu, 18 Sep 2014 11:27:59 +0200
changeset 26830 e67193c2ceda
parent 26829 26315213bab8
child 26831 5c67eb0c46bc
8053998: Hot card cache flush chunk size too coarse grained Summary: Changed the chunk size to a smaller fixed number. Reviewed-by: tschatzl, mgerdin
hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp	Thu Sep 18 12:45:45 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp	Thu Sep 18 11:27:59 2014 +0200
@@ -43,9 +43,7 @@
     _hot_cache_idx = 0;
 
     // For refining the cards in the hot cache in parallel
-    uint n_workers = (ParallelGCThreads > 0 ?
-                        _g1h->workers()->total_workers() : 1);
-    _hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / (int)n_workers);
+    _hot_cache_par_chunk_size = (ParallelGCThreads > 0 ? ClaimChunkSize : _hot_cache_size);
     _hot_cache_par_claimed_idx = 0;
 
     _card_counts.initialize(card_counts_storage);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp	Thu Sep 18 12:45:45 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp	Thu Sep 18 11:27:59 2014 +0200
@@ -70,6 +70,9 @@
 
   G1CardCounts _card_counts;
 
+  // The number of cached cards a thread claims when flushing the cache
+  static const int ClaimChunkSize = 32;
+
   bool default_use_cache() const {
     return (G1ConcRSLogCacheSize > 0);
   }