summaryrefslogtreecommitdiff
path: root/rts/sm/GCUtils.c
diff options
context:
space:
mode:
authorDouglas Wilson <douglas.wilson@gmail.com>2020-12-14 13:55:54 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-17 05:49:54 -0500
commit345ae06b3334a64e9d6db9ea69573ef3227e535a (patch)
tree55fff9e7dccbaf5b8181ce2534c0624a00a5b161 /rts/sm/GCUtils.c
parentf2d118c0a018dccd3c82e885f500d4e57ff94f82 (diff)
downloadhaskell-345ae06b3334a64e9d6db9ea69573ef3227e535a.tar.gz
rts: add max_n_todo_overflow internal counter
I've never observed this counter taking a non-zero value, however I do think it's existence is justified by the comment in grab_local_todo_block. I've not added it to RTSStats in GHC.Stats, as it doesn't seem worth the api churn.
Diffstat (limited to 'rts/sm/GCUtils.c')
-rw-r--r--rts/sm/GCUtils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c
index 89a92bc837..52ea27f263 100644
--- a/rts/sm/GCUtils.c
+++ b/rts/sm/GCUtils.c
@@ -183,6 +183,18 @@ push_todo_block(bdescr *bd, gen_workspace *ws)
bd->link = ws->todo_overflow;
ws->todo_overflow = bd;
ws->n_todo_overflow++;
+
+ // In theory, if a gc thread pushes more blocks to it's todo_q than it
+ // pops, the todo_overflow list will continue to grow. Other gc threads
+ // can't steal from the todo_overflwo list, so they may be idle as the
+ // first gc thread works diligently on it's todo_overflow list. In
+ // practice this has not been observed to occur.
+ //
+ // The max_n_todo_overflow counter will allow us to observe large
+ // todo_overflow lists if they ever arise. As of now I've not observed
+ // any nonzero max_n_todo_overflow samples.
+ gct->max_n_todo_overflow =
+ stg_max(gct->max_n_todo_overflow, ws->n_todo_overflow);
}
#if defined(THREADED_RTS)