Skip to content

WIP: nonmoving gc: Refactor mark queue representation

Ben Gamari requested to merge wip/gc/mark-queue-refactor into master

N.B. This is really only pushed so I can review my own code.

This refactors the mark queue representation to eliminate much of the repetition associated with the three contexts in which mark queues are manipulated:

  • pushing to the update remembered set from the mutator, where on overflow we move the filled MarkQueueBlock to the update remembered set and take the SM mutex to allocate a new block
  • pushing to the update remembered set from the from the minor GC, where on overflow we move the filled block to the update remembered set, take the alloc spinlock to allocate a new block
  • pushing to the mark queue from the concurrent GC, where on overflow we link the filled block onto the mark queue and take the SM mutex to allocate a new block.

This is really an experiment to determine whether the C compiler is able to specialise the switch on MarkContextKind and, if not, how bad the overhead is.

Merge request reports