Spin-less Work-Stealing Parallel Copying Garbage Collection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In parallel copying garbage collection, the spin loop consumes significant CPU resources, necessitating a spin-less work-stealing mechanism to improve efficiency.

Innovation Solution

Implement a method where GC threads register objects for delayed copying based on reference presence and structure, avoiding spin loops by setting forwarding pointers and estimating copy overhead, and limiting the number of delayed copies to maintain load balance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If spin loop is used for work-stealing in parallel copying garbage collection, then load balance is improved, but CPU resource consumption increases

Engineering Contradiction:
Improveload balanceVSAvoidCPU resource consumption
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent applies preliminary action by pre-identifying and registering objects that lack references to other original objects before the copying process begins. These objects are marked in advance for delayed copying, so that when a GC thread needs work, it can immediately process these pre-identified objects without needing to spin-loop through multiple steal attempts. This eliminates the CPU-intensive spin loop while maintaining load balance across threads.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary mechanism - a registration data structure that stores information about objects suitable for delayed copying. This intermediary layer sits between the object identification process and the actual copying execution, allowing threads to efficiently retrieve work from the registration structure rather than engaging in costly spin-loop interactions with other threads. The registration structure acts as a mediator that decouples the load-balancing function from the CPU-intensive spin loop.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If all objects are copied immediately in parallel copying garbage collection, then garbage collection completeness is improved, but copy overhead increases

Engineering Contradiction:
Improvegarbage collection completenessVSAvoidcopy overhead
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by identifying and registering objects suitable for delayed copying before the actual copying phase begins. Objects that lack references to other original objects are pre-marked for delayed copying, allowing the garbage collection to proceed with immediate copying of only those objects that must be copied now, while deferring others to a later phase. This ensures garbage collection completeness is maintained while reducing immediate copy overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements periodic action by dividing the copying process into distinct phases: an immediate copying phase for objects that must be copied now, and a delayed copying phase for objects registered in advance. This periodic structure allows the system to alternate between active copying and deferred copying, ensuring that all objects are eventually copied (maintaining completeness) while spreading the copy overhead across different time periods rather than concentrating it all at once.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS10769063B2Spin-less work-stealing for parallel copying garbage collection
Publication Date: 2020.09.08 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10769063B2 patent drawing
  • US10769063B2 patent drawing
  • US10769063B2 patent drawing

AI summary

Computer-implemented methods, program storage devices, and systems are provided for object copying in a computer performing parallel copying garbage collection on deques using work stealing. A method includes acquiring, for original objects in a source deque space, a destination deque space to copy the original objects to, and copying, from the source deque space to the destination deque space, any original objects in the source deque space having a reference to other ones of the original objects, or having a pre-known structure for estimating copy overhead. The method also includes registering, together with an address to copy to, any original objects in the source deque space lacking the reference to the other ones of the original objects, or lacking the pre-known structure for estimating copy overhead. The method additionally includes setting, in the source space, forwarding pointers to copied ones of the original objects in the destination deque place. The method may further include copying registered objects based on a copy cost or overhead and a spin count, waiting in a spin loop, and trying to steal a task after the spin loop. An upper limit may be imposed on the number of original objects that can be registered to prevent a load balance loss. The parallel copying garbage collection may be performed on a heap of the computer.