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

Setting up post alloc function to set VO bit #59

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

udesou
Copy link

@udesou udesou commented Jun 25, 2024

This PR allows setting mmtk's VO bit using the post_alloc function. I've added an option MMTK_CONSERVATIVE that needs to be set (inside Make.user) in order to enable it. Note that I've also kept the possibility of using the slow path post_alloc for debugging purposes.

@udesou udesou requested a review from qinsoon June 26, 2024 06:18
@udesou udesou marked this pull request as ready for review July 8, 2024 00:16
src/julia.h Outdated
@@ -2536,10 +2556,17 @@ STATIC_INLINE void* mmtk_immortal_alloc_fast(MMTkMutatorContext* mutator, size_t
}

STATIC_INLINE void mmtk_immortal_post_alloc_fast(MMTkMutatorContext* mutator, void* obj, size_t size) {
intptr_t addr = (intptr_t) obj;
Copy link
Member

Choose a reason for hiding this comment

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

The code to set VO bit is exactly the same for all the spaces. You can extract it to be a separate inlined function, and remove the duplicated code in mmtk_immix_post_alloc_fast and mmtk_immortal_post_alloc_fast.

@udesou udesou requested a review from qinsoon July 9, 2024 06:00
Copy link
Member

@qinsoon qinsoon left a comment

Choose a reason for hiding this comment

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

LGTM

@udesou udesou merged commit 084d8a0 into mmtk:v1.9.2+RAI Jul 9, 2024
1 check passed
udesou added a commit to mmtk/mmtk-julia that referenced this pull request Jul 11, 2024
This PR introduces the `is_mmtk_object` feature supporting a valid
object (VO) bit for conservative stack scanning. It also sets this
feature as default.

NB: merge with mmtk/julia#59.
~NB2: it requires a change in `mmtk-core` to expose an api function to
bulk set the VO bit. (see mmtk/mmtk-core#1157
@qinsoon qinsoon mentioned this pull request Dec 3, 2024
qinsoon added a commit that referenced this pull request Dec 3, 2024
This PR ports #59 to `dev`. In addition, this PR 1. introduces `jl_gc_permsymbol` for allocating the special perm object in `mk_symbol`, 2. removes some seemingly unnecessary post alloc calls for `jl_gc_perm_alloc` in `datatype.c`, and 3. does not support set VO bit using the slowpath (MMTk call).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants