diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-03 19:30:41 (GMT) |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-05 21:07:49 (GMT) |
commit | a7a4efbff1badf7daa41256cb506915e4fddee5c (patch) | |
tree | ce9a6e94513ca6d6f7df6e891c70275e6e02f078 | |
parent | 70dd0e4b7051e674479729916285b12fc14c696f (diff) | |
download | ghc-a7a4efbff1badf7daa41256cb506915e4fddee5c.zip ghc-a7a4efbff1badf7daa41256cb506915e4fddee5c.tar.gz ghc-a7a4efbff1badf7daa41256cb506915e4fddee5c.tar.bz2 |
rts/NonMovingSweep: Fix locking of new mutable list allocation
Previously we used allocBlockOnNode_sync in nonmovingSweepMutLists
despite the fact that we aren't in the GC and therefore the allocation
spinlock isn't in use. This meant that sweep would end up spinning until
the next minor GC, when the SM lock was moved away from the SM_MUTEX to
the spinlock. This isn't a correctness issue but it sure isn't good for
performance.
Found thanks for Ward.
Fixes #17539.
-rw-r--r-- | rts/sm/NonMovingSweep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/sm/NonMovingSweep.c b/rts/sm/NonMovingSweep.c index 925d7c2..4465714 100644 --- a/rts/sm/NonMovingSweep.c +++ b/rts/sm/NonMovingSweep.c @@ -281,7 +281,7 @@ void nonmovingSweepMutLists() for (uint32_t n = 0; n < n_capabilities; n++) { Capability *cap = capabilities[n]; bdescr *old_mut_list = cap->mut_lists[oldest_gen->no]; - cap->mut_lists[oldest_gen->no] = allocBlockOnNode_sync(cap->node); + cap->mut_lists[oldest_gen->no] = allocBlockOnNode_lock(cap->node); for (bdescr *bd = old_mut_list; bd; bd = bd->link) { for (StgPtr p = bd->start; p < bd->free; p++) { StgClosure **q = (StgClosure**)p; |