diff options
author | Douglas Wilson <douglas.wilson@gmail.com> | 2021-01-04 12:24:25 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-17 05:49:54 -0500 |
commit | f2d118c0a018dccd3c82e885f500d4e57ff94f82 (patch) | |
tree | 32a8a499034557c4725936922c870c901519a42b | |
parent | f395c2cb2e6bb0b9f9f3d6deb923c72fe7433d37 (diff) | |
download | haskell-f2d118c0a018dccd3c82e885f500d4e57ff94f82.tar.gz |
rts: remove no_work counter
We are no longer busyish waiting, so this is no longer meaningful
-rw-r--r-- | includes/RtsAPI.h | 3 | ||||
-rw-r--r-- | rts/Stats.c | 16 | ||||
-rw-r--r-- | rts/Stats.h | 3 | ||||
-rw-r--r-- | rts/sm/GC.c | 11 | ||||
-rw-r--r-- | rts/sm/GCThread.h | 1 | ||||
-rw-r--r-- | rts/sm/GCUtils.c | 3 |
6 files changed, 6 insertions, 31 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index f88cd0614c..a5e4dfd623 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -266,9 +266,6 @@ typedef struct _RTSStats { // The number of times a GC thread has checked for work across all parallel // GCs uint64_t any_work; - // The number of times a GC thread has checked for work and found none - // across all parallel GCs - uint64_t no_work; // The number of times a GC thread has iterated it's outer loop across all // parallel GCs uint64_t scav_find_work; diff --git a/rts/Stats.c b/rts/Stats.c index cee1a2ad90..02616094b8 100644 --- a/rts/Stats.c +++ b/rts/Stats.c @@ -159,7 +159,6 @@ initStats0(void) .mut_spin_spin = 0, .mut_spin_yield = 0, .any_work = 0, - .no_work = 0, .scav_find_work = 0, .init_cpu_ns = 0, .init_elapsed_ns = 0, @@ -461,8 +460,7 @@ void stat_endGC (Capability *cap, gc_thread *initiating_gct, W_ live, W_ copied, W_ slop, uint32_t gen, uint32_t par_n_threads, gc_thread **gc_threads, W_ par_max_copied, W_ par_balanced_copied, W_ gc_spin_spin, W_ gc_spin_yield, - W_ mut_spin_spin, W_ mut_spin_yield, W_ any_work, W_ no_work, - W_ scav_find_work) + W_ mut_spin_spin, W_ mut_spin_yield, W_ any_work, W_ scav_find_work) { ACQUIRE_LOCK(&stats_mutex); @@ -542,7 +540,6 @@ stat_endGC (Capability *cap, gc_thread *initiating_gct, W_ live, W_ copied, W_ s stats.cumulative_par_balanced_copied_bytes += stats.gc.par_balanced_copied_bytes; stats.any_work += any_work; - stats.no_work += no_work; stats.scav_find_work += scav_find_work; stats.gc_spin_spin += gc_spin_spin; stats.gc_spin_yield += gc_spin_yield; @@ -1027,10 +1024,6 @@ static void report_summary(const RTSSummaryStats* sum) , col_width[2], stats.any_work); statsPrintf("%*s" "%*s" "%*" FMT_Word64 "\n" , col_width[0], "" - , col_width[1], "no_work" - , col_width[2], stats.no_work); - statsPrintf("%*s" "%*s" "%*" FMT_Word64 "\n" - , col_width[0], "" , col_width[1], "scav_find_work" , col_width[2], stats.scav_find_work); #elif defined(THREADED_RTS) // THREADED_RTS && PROF_SPIN @@ -1172,8 +1165,6 @@ static void report_machine_readable (const RTSSummaryStats * sum) whitehole_threadPaused_spin); MR_STAT("any_work", FMT_Word64, stats.any_work); - MR_STAT("no_work", FMT_Word64, - stats.no_work); MR_STAT("scav_find_work", FMT_Word64, stats.scav_find_work); #endif // PROF_SPIN @@ -1619,10 +1610,7 @@ collector. Parallel garbage collector counters: * any_work: - A cheap function called whenever a gc_thread is ready for work. Does - not do any work. -* no_work: - Incremented whenever any_work finds no work. + Incremented whenever a parallel GC looks for work to steal. * scav_find_work: Called to do work when any_work return true. diff --git a/rts/Stats.h b/rts/Stats.h index 9d62acef37..64aec2d5ee 100644 --- a/rts/Stats.h +++ b/rts/Stats.h @@ -37,8 +37,7 @@ void stat_endGC (Capability *cap, struct gc_thread_ *initiating_gct, W_ li uint32_t n_gc_threads, struct gc_thread_ **gc_threads, W_ par_max_copied, W_ par_balanced_copied, W_ gc_spin_spin, W_ gc_spin_yield, W_ mut_spin_spin, - W_ mut_spin_yield, W_ any_work, W_ no_work, - W_ scav_find_work); + W_ mut_spin_yield, W_ any_work, W_ scav_find_work); void stat_startNonmovingGcSync(void); void stat_endNonmovingGcSync(void); diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 64a4c071b6..b78f993260 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -270,7 +270,7 @@ GarbageCollect (uint32_t collect_gen, generation *gen; StgWord live_blocks, live_words, par_max_copied, par_balanced_copied, gc_spin_spin, gc_spin_yield, mut_spin_spin, mut_spin_yield, - any_work, no_work, scav_find_work; + any_work, scav_find_work; #if defined(THREADED_RTS) gc_thread *saved_gct; #endif @@ -593,7 +593,6 @@ GarbageCollect (uint32_t collect_gen, mut_spin_spin = 0; mut_spin_yield = 0; any_work = 0; - no_work = 0; scav_find_work = 0; { uint32_t i; @@ -614,8 +613,6 @@ GarbageCollect (uint32_t collect_gen, RELAXED_LOAD(&thread->scanned) * sizeof(W_)); debugTrace(DEBUG_gc," any_work %ld", RELAXED_LOAD(&thread->any_work)); - debugTrace(DEBUG_gc," no_work %ld", - RELAXED_LOAD(&thread->no_work)); debugTrace(DEBUG_gc," scav_find_work %ld", RELAXED_LOAD(&thread->scav_find_work)); @@ -627,7 +624,6 @@ GarbageCollect (uint32_t collect_gen, #endif any_work += RELAXED_LOAD(&thread->any_work); - no_work += RELAXED_LOAD(&thread->no_work); scav_find_work += RELAXED_LOAD(&thread->scav_find_work); par_max_copied = stg_max(RELAXED_LOAD(&thread->copied), par_max_copied); @@ -1047,7 +1043,7 @@ GarbageCollect (uint32_t collect_gen, N, n_gc_threads, gc_threads, par_max_copied, par_balanced_copied, gc_spin_spin, gc_spin_yield, mut_spin_spin, mut_spin_yield, - any_work, no_work, scav_find_work); + any_work, scav_find_work); #if defined(RTS_USER_SIGNALS) if (RtsFlags.MiscFlags.install_signal_handlers) { @@ -1188,7 +1184,6 @@ freeGcThreads (void) closeCondition(&gc_running_cv); closeMutex(&gc_running_mutex); stgFree (gc_threads); - #else for (g = 0; g < RtsFlags.GcFlags.generations; g++) { @@ -1320,7 +1315,6 @@ scavenge_until_all_done (void) traceEventGcWork(gct->cap); continue; // for(;;) loop } - NONATOMIC_ADD(&gct->no_work, 1); } #endif break; // for(;;) loop @@ -1808,7 +1802,6 @@ init_gc_thread (gc_thread *t) t->copied = 0; t->scanned = 0; t->any_work = 0; - t->no_work = 0; t->scav_find_work = 0; } diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h index d15189988d..90d15c69c5 100644 --- a/rts/sm/GCThread.h +++ b/rts/sm/GCThread.h @@ -182,7 +182,6 @@ typedef struct gc_thread_ { W_ copied; W_ scanned; W_ any_work; - W_ no_work; W_ scav_find_work; Time gc_start_cpu; // thread CPU time diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c index ea7d83ab8f..89a92bc837 100644 --- a/rts/sm/GCUtils.c +++ b/rts/sm/GCUtils.c @@ -129,8 +129,7 @@ steal_todo_block (uint32_t g) // look for work to steal for (n = 0; n < n_gc_threads; n++) { if (n == gct->thread_index) continue; - q = gc_threads[n]->gens[g].todo_q; - bd = stealWSDeque(q); + bd = stealWSDeque(gc_threads[n]->gens[g].todo_q); if (bd) { return bd; } |