summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-12-09 23:10:22 -0500
committerBen Gamari <ben@smart-cactus.org>2020-12-31 15:52:30 -0500
commit191a9d82fe462ae45dc2b13f89fa6a8a3dbfa9ff (patch)
treedee09b375e97adcdfade6b64ee7acd6c4c1cf2bc
parentd4b11c08aae360cab0e1f1fec1d43c7536aa7543 (diff)
downloadhaskell-191a9d82fe462ae45dc2b13f89fa6a8a3dbfa9ff.tar.gz
nonmoving: Don't push objects during deadlock detect GC
Previously we would push large objects and compact regions to the mark queue during the deadlock detect GC, resulting in failure to detect deadlocks. (cherry picked from commit a2731d49d95f7397a6a267a322ed75b0c3a5c246)
-rw-r--r--rts/sm/Evac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 67cc810abb..31dd003a7b 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -436,7 +436,9 @@ evacuate_large(StgPtr p)
__atomic_fetch_or(&bd->flags, BF_NONMOVING, __ATOMIC_ACQ_REL);
// See Note [Non-moving GC: Marking evacuated objects].
- markQueuePushClosureGC(&gct->cap->upd_rem_set.queue, (StgClosure *) p);
+ if (major_gc && !deadlock_detect_gc) {
+ markQueuePushClosureGC(&gct->cap->upd_rem_set.queue, (StgClosure *) p);
+ }
}
initBdescr(bd, new_gen, new_gen->to);
@@ -593,7 +595,9 @@ evacuate_compact (StgPtr p)
__atomic_fetch_or(&bd->flags, BF_NONMOVING, __ATOMIC_RELAXED);
// See Note [Non-moving GC: Marking evacuated objects].
- markQueuePushClosureGC(&gct->cap->upd_rem_set.queue, (StgClosure *) str);
+ if (major_gc && !deadlock_detect_gc) {
+ markQueuePushClosureGC(&gct->cap->upd_rem_set.queue, (StgClosure *) str);
+ }
}
initBdescr(bd, new_gen, new_gen->to);