-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.2 multicore markdelay #3029
5.2 multicore markdelay #3029
Conversation
e3fd82b
to
5e85fe9
Compare
5e85fe9
to
69cd4ed
Compare
(This was automatically closed by Github when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all OK, but definitely needs some more comments in a few places (and possibly some better names for things), as commented.
- Domains now begin marking simultaneously at some minor GC during the major cycle - Before marking, the write barrier is disabled and fresh allocations are UNMARKED - Change to ephemeron logic: per-cycle ephemeron data structure reset is now done at marking start rather than at the start of the cycle. (In particular, this makes orphaned work simpler to deal with) (cherry picked from commit f376410)
Includes several systhreads tests that rely on the interaction between systhreads, domains and backup threads. (cherry picked from commit c31eebd)
…tion (cherry picked from commit 2368930)
69cd4ed
to
5d2b2dc
Compare
I rebased to current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On behalf of Nick Barnes
* Markdelay support for multi-domain programs - Domains now begin marking simultaneously at some minor GC during the major cycle - Before marking, the write barrier is disabled and fresh allocations are UNMARKED - Change to ephemeron logic: per-cycle ephemeron data structure reset is now done at marking start rather than at the start of the cycle. (In particular, this makes orphaned work simpler to deal with) * Re-enable parallel tests Includes several systhreads tests that rely on the interaction between systhreads, domains and backup threads. * Add a new test (tests/parallel/churn.ml) stressing cross-domain promotion
* Markdelay support for multi-domain programs - Domains now begin marking simultaneously at some minor GC during the major cycle - Before marking, the write barrier is disabled and fresh allocations are UNMARKED - Change to ephemeron logic: per-cycle ephemeron data structure reset is now done at marking start rather than at the start of the cycle. (In particular, this makes orphaned work simpler to deal with) * Re-enable parallel tests Includes several systhreads tests that rely on the interaction between systhreads, domains and backup threads. * Add a new test (tests/parallel/churn.ml) stressing cross-domain promotion
This patch extends the existing single-domain-only markdelay patch to work with multiple domains, and (in separate commits) re-enables all the parallel tests and adds a new parallel test.
The idea is to add a new phase,
Phase_sweep_main
, prior toPhase_sweep_and_mark_main
, in which only sweeping and not marking can be done. Since the roots have not yet been marked, it is safe to give new allocations theUNMARKED
status during this phase, allowing them to be collected a cycle earlier than otherwise. Also, caml_modify need not do darkening during this phase. This was implemented for single-domain programs in #2348, and this PR extends it to multi-domain programs.Since domains freely share new allocations, all must agree on phase transitions. So, when any domain finishes sweeping, it requests a transition to Phase_sweep_and_mark_main. Instead of being acted upon directly, this sets a flag to trigger the phase transition at the next minor GC. (The phase transition involves marking roots, which must be done with the minor heap empty, and the simplest way to achieve this is to wait until the next point when the minor heap naturally empties)