diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-29 23:22:40 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-06 04:40:08 -0400 |
commit | 740b3b8df76dabd88bdb3474aad2b287b0960f07 (patch) | |
tree | bec6da1974a6b66c316d8d2943187cd5b84baa1b | |
parent | 420b957df9d831632a3edab682778b11734255f1 (diff) | |
download | haskell-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.c | 7 |
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); |