rename whitehole_spin to evac_collision, and update it properly
authorSimon Marlow <marlowsd@gmail.com>
Wed, 19 Aug 2009 14:15:18 +0000 (14:15 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 19 Aug 2009 14:15:18 +0000 (14:15 +0000)
rts/Stats.c
rts/sm/Evac.c
rts/sm/GC.h
rts/sm/Storage.c

index 6029745..4acddda 100644 (file)
@@ -15,7 +15,7 @@
 #include "Profiling.h"
 #include "GetTime.h"
 #include "sm/Storage.h"
-#include "sm/GC.h" // gc_alloc_block_sync, whitehole_spin
+#include "sm/GC.h" // gc_alloc_block_sync, evac_collision
 
 #if USE_PAPI
 #include "Papi.h"
@@ -704,7 +704,7 @@ stat_exit(int alloc)
                 nat g, s;
                 
                 statsPrintf("gc_alloc_block_sync: %"FMT_Word64"\n", gc_alloc_block_sync.spin);
-                statsPrintf("whitehole_spin: %"FMT_Word64"\n", whitehole_spin);
+                statsPrintf("evac_collision: %"FMT_Word64"\n", evac_collision);
                 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
                     for (s = 0; s < generations[g].n_steps; s++) {
                         statsPrintf("gen[%d].steps[%d].sync_large_objects: %"FMT_Word64"\n", g, s, generations[g].steps[s].sync_large_objects.spin);
index b711914..c40d18b 100644 (file)
@@ -25,7 +25,7 @@
 #include "LdvProfile.h"
 
 #if defined(PROF_SPIN) && defined(THREADED_RTS) && defined(PARALLEL_GC)
-StgWord64 whitehole_spin = 0;
+StgWord64 evac_collision = 0;
 #endif
 
 #if defined(THREADED_RTS) && !defined(PARALLEL_GC)
@@ -115,7 +115,10 @@ copy_tag(StgClosure **p, const StgInfoTable *info,
         new_info = (const StgInfoTable *)cas((StgPtr)&src->header.info,
                                              (W_)info, MK_FORWARDING_PTR(to));
         if (new_info != info) {
-            return evacuate(p); // does the failed_to_evac stuff
+#if defined(PROF_SPIN)
+            evac_collision++;
+#endif
+            evacuate(p); // does the failed_to_evac stuff
         } else {
             *p = TAG_CLOSURE(tag,(StgClosure*)to);
         }
@@ -191,6 +194,9 @@ copyPart(StgClosure **p, const StgInfoTable *info, StgClosure *src,
         new_info = (const StgInfoTable *)cas((StgPtr)&src->header.info, 
                                              (W_)info, MK_FORWARDING_PTR(to));
         if (new_info != info) {
+#if defined(PROF_SPIN)
+            evac_collision++;
+#endif
             evacuate(p); // does the failed_to_evac stuff
             return rtsFalse;
         } else {
index e746f09..675d323 100644 (file)
@@ -42,7 +42,7 @@ extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
 #endif
 
 #if defined(PROF_SPIN) && defined(THREADED_RTS)
-extern StgWord64 whitehole_spin;
+extern StgWord64 evac_collision;
 #endif
 
 void gcWorkerThread (Capability *cap);
index 59a41b0..19ccdfb 100644 (file)
@@ -253,7 +253,7 @@ initStorage( void )
 
 #ifdef THREADED_RTS
   initSpinLock(&gc_alloc_block_sync);
-  whitehole_spin = 0;
+  evac_collision = 0;
 #endif
 
   N = 0;