-
Notifications
You must be signed in to change notification settings - Fork 1.2k
GC work accounting fixes (oxcaml#3618) #14329
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
Conversation
------ Major GC work accounting fixes (oxcaml#3618) The goal is to make the amount of "work" done by the major GC in a cycle match what the pacing logic expects: - Marking: work is the size of the reachable data - Sweeping: work is the size of the allocated data (reachable or not) There are two fixes in this patch to make this closer to true: - Extra marking work done by caml_darken should count towards the total - Free blocks should not count for sweeping work The former makes a noticeable difference on some weird programs, and a new test (darkening_work.ml) is added to demonstrate this. (It fails on all prior versions of OCaml, as far as I've tested). The latter doesn't really make much difference in practice, as the amount of free blocks in in-use pools tends to be low, but it makes the code closer to the theory.
|
@damiendoligez @stedolan I understand the small book-keeping fixes, but I have two related question:
Naively I would expect one of the following: a. b. |
At the moment that's true. The next GC pacing patch uses separate units for mark work and sweep work, and separating the "between slices" counters here makes that easier.
There are two places where These places are where some work has been incorrectly attributed to "work done between slices" despite being part of the slice, because of the structure of |
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.
I am okay with the proposed changes, approved.
This PR is a prerequisite of #14324 .
Here is the original message for this patch:
Major GC work accounting fixes (oxcaml/oxcaml#3618)
The goal is to make the amount of "work" done by the major GC in a cycle match what the pacing logic expects:
There are two fixes in this patch to make this closer to true:
The former makes a noticeable difference on some weird programs, and a new test (darkening_work.ml) is added to demonstrate this. (It fails on all prior versions of OCaml, as far as I've tested). The latter doesn't really make much difference in practice, as the amount of free blocks in in-use pools tends to be low, but it makes the code closer to the theory.