changeset 9732:943f36515734

Merge
author tschatzl
date Wed, 02 Sep 2015 16:16:58 +0200
parents 116afd2a8cbd (current diff) 7eec02b95f9e (diff)
children d487a586ed9c
files src/share/vm/gc/shared/gcTrace.cpp
diffstat 6 files changed, 30 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Sep 02 16:16:58 2015 +0200
@@ -181,15 +181,6 @@
     G1ErgoVerbose::set_enabled(false);
   }
 
-  // Verify PLAB sizes
-  const size_t region_size = HeapRegion::GrainWords;
-  if (YoungPLABSize > region_size || OldPLABSize > region_size) {
-    char buffer[128];
-    jio_snprintf(buffer, sizeof(buffer), "%sPLABSize should be at most " SIZE_FORMAT,
-                 OldPLABSize > region_size ? "Old" : "Young", region_size);
-    vm_exit_during_initialization(buffer);
-  }
-
   _recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime());
   _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0;
 
--- a/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Wed Sep 02 16:16:58 2015 +0200
@@ -186,6 +186,21 @@
   return dest(state);
 }
 
+void G1ParScanThreadState::report_promotion_event(InCSetState const dest_state,
+                                                  oop const old, size_t word_sz, uint age,
+                                                  HeapWord * const obj_ptr,
+                                                  const AllocationContext_t context) const {
+  G1PLAB* alloc_buf = _plab_allocator->alloc_buffer(dest_state, context);
+  if (alloc_buf->contains(obj_ptr)) {
+    _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz, age,
+                                                             dest_state.value() == InCSetState::Old,
+                                                             alloc_buf->word_sz());
+  } else {
+    _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz, age,
+                                                              dest_state.value() == InCSetState::Old);
+  }
+}
+
 oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
                                                  oop const old,
                                                  markOop const old_mark) {
@@ -219,6 +234,10 @@
         return handle_evacuation_failure_par(old, old_mark);
       }
     }
+    if (_g1h->_gc_tracer_stw->should_report_promotion_events()) {
+      // The events are checked individually as part of the actual commit
+      report_promotion_event(dest_state, old, word_sz, age, obj_ptr, context);
+    }
   }
 
   assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
--- a/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Wed Sep 02 16:16:58 2015 +0200
@@ -173,6 +173,10 @@
                                   bool previous_plab_refill_failed);
 
   inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
+
+  void report_promotion_event(InCSetState const dest_state,
+                              oop const old, size_t word_sz, uint age,
+                              HeapWord * const obj_ptr, const AllocationContext_t context) const;
  public:
 
   oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
--- a/src/share/vm/gc/shared/gcTrace.cpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/gc/shared/gcTrace.cpp	Wed Sep 02 16:16:58 2015 +0200
@@ -175,6 +175,11 @@
   _tenuring_threshold = tenuring_threshold;
 }
 
+bool YoungGCTracer::should_report_promotion_events() const {
+  return should_report_promotion_in_new_plab_event() ||
+          should_report_promotion_outside_plab_event();
+}
+
 bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
   return should_send_promotion_in_new_plab_event();
 }
--- a/src/share/vm/gc/shared/gcTrace.hpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/gc/shared/gcTrace.hpp	Wed Sep 02 16:16:58 2015 +0200
@@ -172,6 +172,7 @@
    *
    * plab_size is the size of the newly allocated PLAB in bytes.
    */
+  bool should_report_promotion_events() const;
   bool should_report_promotion_in_new_plab_event() const;
   bool should_report_promotion_outside_plab_event() const;
   void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
--- a/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Wed Sep 02 11:56:10 2015 +0200
+++ b/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Wed Sep 02 16:16:58 2015 +0200
@@ -121,7 +121,7 @@
     CommandLineError::print(verbose,
                             "%s (" SIZE_FORMAT ") must be "
                             "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
-                            name, value, PLAB::min_size());
+                            name, value, PLAB::max_size());
     return Flag::VIOLATES_CONSTRAINT;
   }
 #endif // INCLUDE_ALL_GCS