summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-29 23:22:40 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-06 04:40:08 -0400
commit740b3b8df76dabd88bdb3474aad2b287b0960f07 (patch)
treebec6da1974a6b66c316d8d2943187cd5b84baa1b
parent420b957df9d831632a3edab682778b11734255f1 (diff)
downloadhaskell-740b3b8df76dabd88bdb3474aad2b287b0960f07.tar.gz
nonmoving: Fix incorrect failed_to_evac value during deadlock gc
Previously we would incorrectly set the failed_to_evac flag if we evacuated a value due to a deadlock GC. This would cause us to mark more things as dirty than strictly necessary. It also turned up a nasty but which I will fix next.
-rw-r--r--rts/sm/Evac.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index e9a1c5d796..0ece06016a 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -80,16 +80,15 @@ alloc_for_copy (uint32_t size, uint32_t gen_no)
if (gen_no < gct->evac_gen_no) {
if (gct->eager_promotion) {
gen_no = gct->evac_gen_no;
+ } else if (RTS_UNLIKELY(RtsFlags.GcFlags.useNonmoving) && deadlock_detect_gc) {
+ /* See Note [Deadlock detection under nonmoving collector]. */
+ gen_no = oldest_gen->no;
} else {
gct->failed_to_evac = true;
}
}
if (RTS_UNLIKELY(RtsFlags.GcFlags.useNonmoving)) {
- /* See Note [Deadlock detection under nonmoving collector]. */
- if (deadlock_detect_gc)
- gen_no = oldest_gen->no;
-
if (gen_no == oldest_gen->no) {
gct->copied += size;
to = nonmovingAllocate(gct->cap, size);