From 740b3b8df76dabd88bdb3474aad2b287b0960f07 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 29 Apr 2020 23:22:40 -0400 Subject: 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. --- rts/sm/Evac.c | 7 +++---- 1 file 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); -- cgit v1.2.1