NonMoving: Prefetch allocated block for write
authorBen Gamari <ben@smart-cactus.org>
Sat, 18 May 2019 15:02:10 +0000 (11:02 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 21 May 2019 13:39:37 +0000 (09:39 -0400)
This allows us to overlap bringing the block into cache with the search
for the next available block.

rts/sm/NonMoving.c

index e58fe34..0673d54 100644 (file)
@@ -468,6 +468,7 @@ void *nonmovingAllocate(Capability *cap, StgWord sz)
     struct NonmovingSegment *current = alloca->current[cap->no];
     ASSERT(current); // current is never NULL
     void *ret = nonmovingSegmentGetBlock_(current, log_block_size, current->next_free);
+    prefetchForWrite(ret);
     ASSERT(GET_CLOSURE_TAG(ret) == 0); // check alignment
 
     // Advance the current segment's next_free or allocate a new segment if full