changeset 38157:49d65a3ea6b6

8155229: Tune thread usage for live data clearing Reviewed-by: mgerdin, drwhite
author tschatzl
date Mon, 02 May 2016 10:24:41 +0200
parents e0ff734fa7de
children dd85f2d97400
files hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp	Mon May 02 10:24:41 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp	Mon May 02 10:24:41 2016 +0200
@@ -424,9 +424,12 @@
   guarantee(Universe::is_fully_initialized(), "Should not call this during initialization.");
 
   size_t const num_chunks = align_size_up(live_cards_bm().size_in_bytes(), G1ClearCardLiveDataTask::chunk_size()) / G1ClearCardLiveDataTask::chunk_size();
+  uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers());
 
   G1ClearCardLiveDataTask cl(live_cards_bm(), num_chunks);
-  workers->run_task(&cl);
+
+  log_debug(gc, ergo)("Running %s using %u workers for " SIZE_FORMAT " work units.", cl.name(), num_workers, num_chunks);
+  workers->run_task(&cl, num_workers);
 
   // The region live bitmap is always very small, even for huge heaps. Clear
   // directly.