summaryrefslogtreecommitdiff
path: root/rts/sm/GC.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-08 21:28:35 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:18:39 -0400
commit8e79e2a973c1e4730a1caf402898f6607f84af45 (patch)
treef7866f31d53503b333a10f573140efc15d506344 /rts/sm/GC.c
parent3bc172a41c43ebe3d81caf4d75f10cfb48218006 (diff)
downloadhaskell-8e79e2a973c1e4730a1caf402898f6607f84af45.tar.gz
Unconditionally flush update remembered set during minor GCwip/gc/optimize
Flush the update remembered set. The goal here is to flush periodically to ensure that we don't end up with a thread who marks their stack on their local update remembered set and doesn't flush until the nonmoving sync period as this would result in a large fraction of the heap being marked during the sync pause.
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r--rts/sm/GC.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 6be81e5ff0..83e9c97bd9 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -730,6 +730,14 @@ GarbageCollect (uint32_t collect_gen,
}
} // for all generations
+ // Flush the update remembered set. See Note [Eager update remembered set
+ // flushing] in NonMovingMark.c
+ if (RtsFlags.GcFlags.useNonmoving) {
+ RELEASE_SM_LOCK;
+ nonmovingAddUpdRemSetBlocks(&gct->cap->upd_rem_set.queue);
+ ACQUIRE_SM_LOCK;
+ }
+
// Mark and sweep the oldest generation.
// N.B. This can only happen after we've moved
// oldest_gen->scavenged_large_objects back to oldest_gen->large_objects.