< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahWorkGroup.cpp

Print this page
rev 10522 : [backport] Added logging for the number of workers used for GC cycles
rev 10530 : [backport] AlwaysPreTouch fails with non-default ConcGCThreads
rev 10598 : [backport] Shenandoah changes to allow enabling -Wreorder

@@ -22,28 +22,36 @@
  */
 
 #include "precompiled.hpp"
 #include "gc_implementation/shenandoah/shenandoahHeap.hpp"
 #include "gc_implementation/shenandoah/shenandoahWorkGroup.hpp"
+#include "gc_implementation/shenandoah/shenandoahLogging.hpp"
+
+ShenandoahWorkerScope::ShenandoahWorkerScope(ShenandoahWorkGang* workers, uint nworkers, const char* msg) :
+  _n_workers(nworkers),
+  _workers(workers) {
+  assert(msg != NULL, "Missing message");
+  log_info(gc, task)("Using %u of %u workers for %s",
+                     nworkers, ShenandoahHeap::heap()->max_workers(), msg);
  
-ShenandoahWorkerScope::ShenandoahWorkerScope(ShenandoahWorkGang* workers, uint nworkers) :
-  _workers(workers), _n_workers(nworkers) {
   ShenandoahHeap::heap()->assert_gc_workers(nworkers);
   _workers->set_active_workers(nworkers);
 }
 
 ShenandoahWorkerScope::~ShenandoahWorkerScope() {
   assert(_workers->active_workers() == _n_workers,
     "Active workers can not be changed within this scope");
 }
 
 ShenandoahPushWorkerScope::ShenandoahPushWorkerScope(ShenandoahWorkGang* workers, uint nworkers, bool check) :
-  _workers(workers), _old_workers(workers->active_workers()), _n_workers(nworkers) {
+  _n_workers(nworkers),
+  _old_workers(workers->active_workers()),
+  _workers(workers) {
   _workers->set_active_workers(nworkers);
 
   // bypass concurrent/parallel protocol check for non-regular paths, e.g. verifier, etc.
-  if (!check) {
+  if (check) {
     ShenandoahHeap::heap()->assert_gc_workers(nworkers);
   }
 }
 
 ShenandoahPushWorkerScope::~ShenandoahPushWorkerScope() {
< prev index next >