-
Notifications
You must be signed in to change notification settings - Fork 3
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
Differentiate OBJ_PIN and PTR_PIN. Add more pinning. Trace all global roots. #84
Conversation
Differentiate ptr pin and obj pin for hash maps
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.
A general note is that you should probably add comments to all the points you're pinning objects (maybe not for the *HASH_PIN
ones).
@@ -66,7 +66,7 @@ JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *modu | |||
jl_typename_type); | |||
// Typenames should be pinned since they are used as metadata, and are | |||
// read during scan_object | |||
PTR_PIN(tn); | |||
OBJ_PIN(tn); |
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.
Should typenames be allocated in a non-moving space? Maybe add a FIXME
comment saying that instead of pinning them, we might do that instead.
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 have a commit to add an allocation function jl_gc_alloc_non_moving_
and use it for cases like this. Do you want me to include the change in this PR? I planned to have it as a separate PR after this one, but I can include it here.
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 commit: qinsoon@70a4e14
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.
Happy for it to be a separate PR. 👍
|
||
#define TRACE_GLOBALLY_ROOTED(r) add_node_to_roots_buffer(closure, buf, buf_len, r) | ||
|
||
// This is a list of global variables that are marked with JL_GLOBALLY_ROOTED. We need to make sure that they |
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.
For now this is fine, but I wonder whether we should try to capture this automatically somehow. It's a bit of a pain that you had to add all these variables manually.
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.
LGTM.
… roots. (mmtk#84) This PR * differentiates `OBJ_PIN` from `PTR_PIN`. In rare cases, we have to deal with internal pointers, and have to use `PTR_PIN`. * pins more objects that cannot be moved. * traces all the `JL_GLOBALLY_ROOTED` symbols. This PR still transitively pins `jl_global_roots_list`. Without transitive pinning, we observed assertions failures in the precompilation step during Julia build, saying we reach objects without the valid object bit. This issue will be debugged and fixed after this PR.
This PR
OBJ_PIN
fromPTR_PIN
. In rare cases, we have to deal with internal pointers, and have to usePTR_PIN
.JL_GLOBALLY_ROOTED
symbols.This PR still transitively pins
jl_global_roots_list
. Without transitive pinning, we observed assertions failures in the precompilation step during Julia build, saying we reach objects without the valid object bit. This issue will be debugged and fixed after this PR.