Skip to content
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

Remove transitive pinning of global_roots_table #170

Merged
merged 25 commits into from
Oct 13, 2024

Conversation

qinsoon
Copy link
Member

@qinsoon qinsoon commented Aug 30, 2024

This PR removes the transitive pinning of global_roots_table. To be specific, this PR

  • treats each JL_GLOBALLY_ROOTED symbol as a root (trace and not move them).
  • uses stack active start and end to reduce the time for stack scanning in mmtk_jl_task_stack_buffer.
  • introduces pointer pin to handle internal pointesr, along with the existing object pin.
  • sets the VO bit for the boot image.
  • addtionally scans the PTLS stack.
  • changes some info-level logging to debug-level.

@qinsoon qinsoon requested a review from udesou August 30, 2024 00:16
julia/mmtk_julia.c Outdated Show resolved Hide resolved
@qinsoon qinsoon force-pushed the pin-globally-rooted-symbols branch from 3e3796c to a9afe84 Compare September 6, 2024 05:44
@qinsoon qinsoon changed the title Trace globally rooted and make sure they don't move Remove transitive pinning of global_roots_table Sep 25, 2024
Copy link
Contributor

@udesou udesou left a comment

Choose a reason for hiding this comment

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

I think the code looks good, but you might want to include in the PR description what you had to do in terms of pinning (pinning objects and dealing with internal pointers) just to keep track of what has changed. I think that it is a consequence of getting rid of the transitive pinning of the global_roots_table, so the title is fine, but in the description you only mention the changes to the global variables.

qinsoon added a commit to mmtk/julia that referenced this pull request Oct 11, 2024
This PR adds a few more pining for types in the native heap, and exposes globally rooted symbols so we can trace them in the MMTk binding. With this PR, we can run moving Immix without transitively pinning `global_roots_table`. See mmtk/mmtk-julia#170.
* Add `jl_gc_pin`
* Use `jl_gc_pin` to pin `BigFloat` for MPFR
* Rename `PTR_PIN` to `OBJ_PIN`. Additionally add `PTR_PIN` which handles cases for internal pointers.
* Pin objects that are used as key in `jl_codectx_t.global_targets`
* Pin objects that are stored in `jl_codectx_t.PhiNodes`
* Pin objects that are referred to by `jl_cgval_t`
* Disable GC before doing perm alloc in `jl_get_layout` (see mmtk/mmtk-julia#172)
* Pin weak references and the referee (see mmtk/mmtk-julia#176)
* Pin objects that are used in `libuv`'s handle.
* Pin `jl_task_t.completion_future` (see mmtk/mmtk-julia#179)
* Pin all `jl_codeinst_t` objects.
* Pin all `jl_method_instance_t` objects.
* Pin all `jl_module_t` objects.
* Pin all `jl_task_t` objects.
* Expose some `JL_GLOBALLY_ROOTED` symbols, such as `newly_inferred`, `task_done_hook_func`.
@qinsoon qinsoon merged commit 86d8b26 into mmtk:v1.9.2+RAI Oct 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants