Skip to content
Snippets Groups Projects
Commit d37352ea authored by Ben Gamari's avatar Ben Gamari
Browse files

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.

(cherry picked from commit af247ff8)
parent c5d2bab5
No related merge requests found
...@@ -280,7 +280,7 @@ void nonmovingSweepMutLists() ...@@ -280,7 +280,7 @@ void nonmovingSweepMutLists()
for (uint32_t n = 0; n < n_capabilities; n++) { for (uint32_t n = 0; n < n_capabilities; n++) {
Capability *cap = capabilities[n]; Capability *cap = capabilities[n];
bdescr *old_mut_list = cap->mut_lists[oldest_gen->no]; 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 (bdescr *bd = old_mut_list; bd; bd = bd->link) {
for (StgPtr p = bd->start; p < bd->free; p++) { for (StgPtr p = bd->start; p < bd->free; p++) {
StgClosure **q = (StgClosure**)p; StgClosure **q = (StgClosure**)p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment