Commit eb465927 authored by Ben Gamari's avatar Ben Gamari 🐢

NonMoving: Allocate mark queues in larger block groups

parent 9ef76b05
......@@ -361,7 +361,7 @@ push (MarkQueue *q, const MarkQueueEnt *ent)
} else {
// allocate a fresh block.
ACQUIRE_SM_LOCK;
bdescr *bd = allocGroup(1);
bdescr *bd = allocGroup(MARK_QUEUE_BLOCKS);
bd->link = q->blocks;
q->blocks = bd;
q->top = (MarkQueueBlock *) bd->start;
......@@ -392,7 +392,7 @@ markQueuePushClosureGC (MarkQueue *q, StgClosure *p)
// Yes, this block is full.
// allocate a fresh block.
ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync);
bdescr *bd = allocGroup(1);
bdescr *bd = allocGroup(MARK_QUEUE_BLOCKS);
bd->link = q->blocks;
q->blocks = bd;
q->top = (MarkQueueBlock *) bd->start;
......@@ -742,7 +742,7 @@ again:
/* Must hold sm_mutex. */
static void init_mark_queue_ (MarkQueue *queue)
{
bdescr *bd = allocGroup(1);
bdescr *bd = allocGroup(MARK_QUEUE_BLOCKS);
queue->blocks = bd;
queue->top = (MarkQueueBlock *) bd->start;
queue->top->head = 0;
......
......@@ -93,8 +93,11 @@ typedef struct {
MarkQueue queue;
} UpdRemSet;
// Number of blocks to allocate for a mark queue
#define MARK_QUEUE_BLOCKS 16
// The length of MarkQueueBlock.entries
#define MARK_QUEUE_BLOCK_ENTRIES ((BLOCK_SIZE - sizeof(MarkQueueBlock)) / sizeof(MarkQueueEnt))
#define MARK_QUEUE_BLOCK_ENTRIES ((MARK_QUEUE_BLOCKS * BLOCK_SIZE - sizeof(MarkQueueBlock)) / sizeof(MarkQueueEnt))
extern bdescr *nonmoving_large_objects, *nonmoving_marked_large_objects;
extern memcount n_nonmoving_large_blocks, n_nonmoving_marked_large_blocks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment