diff src/share/vm/gc_implementation/g1/heapRegion.cpp @ 17755:96b1c2e06e25

8027295: Free CSet takes ~50% of young pause time Summary: Improve fast card cache iteration and avoid taking locks when freeing the collection set. Reviewed-by: brutisso
author tschatzl
date Mon, 24 Mar 2014 15:30:36 +0100
parents 191174b49bec
children 8ee855b4e667
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Mon Mar 24 15:30:30 2014 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Mon Mar 24 15:30:36 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -205,7 +205,7 @@
   init_top_at_mark_start();
 }
 
-void HeapRegion::hr_clear(bool par, bool clear_space) {
+void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
   assert(_humongous_type == NotHumongous,
          "we should have already filtered out humongous regions");
   assert(_humongous_start_region == NULL,
@@ -223,7 +223,11 @@
   if (!par) {
     // If this is parallel, this will be done later.
     HeapRegionRemSet* hrrs = rem_set();
-    hrrs->clear();
+    if (locked) {
+      hrrs->clear_locked();
+    } else {
+      hrrs->clear();
+    }
     _claimed = InitialClaimValue;
   }
   zero_marked_bytes();