diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-29 23:22:40 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-04-30 12:05:52 -0400 |
commit | 0c7069c77379725f45a05634ff92dc4e5129cc0b (patch) | |
tree | d264c168dba573274f1101802b1cc613d370a881 | |
parent | 0aceee9089eb9d58e481661bfa59b246ccb2c110 (diff) | |
download | haskell-0c7069c77379725f45a05634ff92dc4e5129cc0b.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); |