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
[GC] Change the goal of the marking phase. #7303
Comments
Comment author: @lpw25
Without reading the description too carefully, I think you are roughly describing a Dijkstra barrier, as opposed to the Yuasa barrier currently used by OCaml. |
Comment author: bobot
Thanks a lot! It seems exactly that. With these keywords, for the one interested, an article that describes different kinds of GC barrier and their respective cache locality https://www.cs.kent.ac.uk/pubs/2010/3012/content.pdf . Interestingly there is an issue on ocaml-multicore for going in the other way: ocaml-multicore/ocaml-multicore#41 |
Comment author: @mshinwell @bobot Does this issue need to remain open? |
Comment author: bobot No it can be closed. I'm just going to paste the reason given by multicore:
Changing the runtime for removing the need for |
Comment author: @damiendoligez We might want to change the weak hash tables along the lines suggested by sawfish in #7279#c16109 but yes, changing the barrier means introducing a pause at the end of the major GC. |
Original bug ID: 7303
Reporter: bobot
Status: closed (set by @mshinwell on 2016-12-09T11:38:28Z)
Resolution: not a bug
Priority: low
Severity: feature
Category: runtime system and C interface
Monitored by: braibant @ygrek
Bug description
In one sentence, currently the GC aims at marking at the end of the marking phase all the values reachable during any time of the marking phase, however the correctness of the GC ask only for the values reachable at the end of the marking phase.
The current behavior simplify the understanding of the marking phase, however it forces some useless value to be marked (eg. overwritten values and value obtained from weak pointer). In light of #7279, it can be interesting to accept to not mark them.
Currently the marking phase (simplified):
caml_modify
Weak.get
The idea would be to distinguish two kind of roots:
caml_modify
(global ocaml variable)And modify all the marking algorithm:
caml_modify
The advantage is that overwritten values and value obtained from weak pointer don't have to be marked. The function
Weak.get_copy
can be deprecated in favor ofWeak.get
, since there is no more advantage and contrary to the oldWeak.get_copy
the children of the value are not marked.Do you think this algorithm is correct? Is it used in another GC?
The text was updated successfully, but these errors were encountered: