changeset 5682:588dc45c2068

Merge
author asaha
date Wed, 15 Oct 2014 10:44:33 -0700
parents 7d3ba5ccfc7c (current diff) d81faf9016ce (diff)
children 6896dab06a91 cd3fb27fc3fa
files .hgtags
diffstat 6 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 13 15:10:49 2014 -0700
+++ b/.hgtags	Wed Oct 15 10:44:33 2014 -0700
@@ -751,6 +751,7 @@
 ac701f87d1ea46033c69f3e1cb84fc0a971da70c jdk7u72-b13
 d9b56c6bdddb6f9d8242230f5fdd58f9c7d30ea5 jdk7u72-b14
 a6ae698522bfab3c595a4f8c2c3ee7e8939eb1bb jdk7u72-b30
+492a2abed4ca015459e24f7348233531b7e929d2 jdk7u72-b31
 e6b6d91b3934c281086f8efacb0926e7451cc18b jdk7u75-b00
 9096ac248b379a0f3012f18c7289ec47cdef8459 jdk7u75-b01
 a6964b2822d906eab9c923cdd723cf3dd4facfcd jdk7u75-b02
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Mon Oct 13 15:10:49 2014 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Oct 15 10:44:33 2014 -0700
@@ -757,7 +757,7 @@
   // Support for parallelizing survivor space rescan
   if ((CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) || CMSParallelInitialMarkEnabled) {
     const size_t max_plab_samples =
-      ((DefNewGeneration*)_young_gen)->max_survivor_size()/MinTLABSize;
+      ((DefNewGeneration*)_young_gen)->max_survivor_size() / plab_sample_minimum_size();
 
     _survivor_plab_array  = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC);
     _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC);
@@ -824,6 +824,12 @@
   _inter_sweep_timer.start();  // start of time
 }
 
+size_t CMSCollector::plab_sample_minimum_size() {
+  // The default value of MinTLABSize is 2k, but there is
+  // no way to get the default value if the flag has been overridden.
+  return MAX2(ThreadLocalAllocBuffer::min_size() * HeapWordSize, 2 * K);
+}
+
 const char* ConcurrentMarkSweepGeneration::name() const {
   return "concurrent mark-sweep generation";
 }
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Mon Oct 13 15:10:49 2014 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Wed Oct 15 10:44:33 2014 -0700
@@ -766,6 +766,10 @@
   size_t*    _cursor;
   ChunkArray* _survivor_plab_array;
 
+  // A bounded minimum size of PLABs, should not return too small values since
+  // this will affect the size of the data structures used for parallel young gen rescan
+  size_t plab_sample_minimum_size();
+
   // Support for marking stack overflow handling
   bool take_from_overflow_list(size_t num, CMSMarkStack* to_stack);
   bool par_take_from_overflow_list(size_t num,
--- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp	Mon Oct 13 15:10:49 2014 -0700
+++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp	Wed Oct 15 10:44:33 2014 -0700
@@ -62,7 +62,8 @@
   ParGCAllocBuffer(size_t word_sz);
 
   static const size_t min_size() {
-    return ThreadLocalAllocBuffer::min_size();
+    // Make sure that we return something that is larger than AlignmentReserve
+    return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
   }
 
   static const size_t max_size() {
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp	Mon Oct 13 15:10:49 2014 -0700
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp	Wed Oct 15 10:44:33 2014 -0700
@@ -240,22 +240,19 @@
 }
 
 size_t ThreadLocalAllocBuffer::initial_desired_size() {
-  size_t init_sz;
+  size_t init_sz = 0;
 
   if (TLABSize > 0) {
-    init_sz = MIN2(TLABSize / HeapWordSize, max_size());
-  } else if (global_stats() == NULL) {
-    // Startup issue - main thread initialized before heap initialized.
-    init_sz = min_size();
-  } else {
+    init_sz = TLABSize / HeapWordSize;
+  } else if (global_stats() != NULL) {
     // Initial size is a function of the average number of allocating threads.
     unsigned nof_threads = global_stats()->allocating_threads_avg();
 
     init_sz  = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) /
                       (nof_threads * target_refills());
     init_sz = align_object_size(init_sz);
-    init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
   }
+  init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
   return init_sz;
 }
 
--- a/src/share/vm/memory/threadLocalAllocBuffer.hpp	Mon Oct 13 15:10:49 2014 -0700
+++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Oct 15 10:44:33 2014 -0700
@@ -103,7 +103,7 @@
     // do nothing.  tlabs must be inited by initialize() calls
   }
 
-  static const size_t min_size()                 { return align_object_size(MinTLABSize / HeapWordSize); }
+  static const size_t min_size()                 { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); }
   static const size_t max_size();
 
   HeapWord* start() const                        { return _start; }