Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Minor GC: restrict global roots scanning to one domain #463

Merged

Conversation

Sudha247
Copy link
Collaborator

Currently, all live domains scan all the global roots during a minor collection. This patch restricts the global root scanning in minor GC to just one domain. The first domain to reach the scanning part carries on the scanning, with a lock around it. Once it is done, a flag is updated, which indicates that other domains need not scan the global roots.
This is of the patches addressing #424.

The sequential and parallel macro benchmark results for this, are below.

Sequential - Normalised time
image

Parallel - Time
image

Results for the Global roots parallel micro benchmark globroots_mp.ml with 10000 roots from ocaml-bench/sandmark#200:

Number of domains parallel_minor_gc minor-gc-globroots
1 0.254 0.256
2 0.443 0.439
4 0.556 0.54
8 0.815 0.812
12 1.11 1.039
16 1.88 1.88
20 2.099 2.1
24 2.549 2.518

There is no huge difference between the two branches, this could be due to overheads lying elsewhere.

Examining the eventlogs produced by produce by the same microbenchmark on 12 domains (for a representative value), the event minor_gc/global_roots was found 68081 times in parallel_minor_gc and only 5983 times with this patch.

Copy link
Collaborator

@ctk21 ctk21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ctk21 ctk21 merged commit 005a2e1 into ocaml-multicore:parallel_minor_gc Jan 13, 2021
sadiqj pushed a commit to sadiqj/ocaml that referenced this pull request Jan 10, 2022
…minor-gc-globroots

Minor GC: restrict global roots scanning to one domain
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants