-
Notifications
You must be signed in to change notification settings - Fork 69
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
Move some states from BasePlan to GlobalState #949
Conversation
Nice work. This PR addressed some long-standing issues. Issue #532: The last work item in that issue is moving Issue #587: That issue mentioned some fields that were accidentally added to #587 (comment) also mentioned some previous static methods in JikesRVM MMTk. Those methods were in |
The refactoring seems to slow down the STW/GC time. I can't find an obvious reason that causes the slowdown. I will create separate PRs for a subset of changes, evaluate and merge them separately. |
The PR does not seem to have any measurable performance difference. The following is the total time for 4 plans, SemiSpace, GenCopy, Immix and GenImmix. More details can be found in the link: plotty SemiSpaceGenCopyImmixGenImmix |
// TODO: I don't know how this can be implemented when we have multiple MMTk instances. | ||
// This function is used by space and phase to refer to the current plan. | ||
// Possibly we should remove the use of this function, and remove this function? | ||
fn global() -> &'static dyn Plan<VM = VM>; |
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 will update bindings for this change.
src/util/alloc/malloc_allocator.rs
Outdated
/// [`Plan`] instance that this allocator instance is associated with. | ||
plan: &'static dyn Plan<VM = VM>, | ||
context: Arc<AllocatorContext<VM>>, | ||
_pad: usize, |
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 currently use a padding field to make sure the size of the allocator types stays the same as before. I plan to remove this field, and update the bindings.
@wks Can you review this PR? I haven't created binding PRs for it, but I would like to get some reviews for the PR first. Updating bindings should be straightforward after that. |
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.
The mmtk.h
headers need to be updated to remove the modify_check
functions.
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 finished this pass of reviewing. Generally speaking this is a nice PR that solves some long-standing structural problems.
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.
The mmtk-core part looks good to me. Just ensure bindings are fixed as well.
This PR is not ready for merge. The binding PRs need to be ready, reviewed and approved before we can merge this PR. |
binding-refs |
Updates to mmtk/mmtk-core#949. --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
Updates to mmtk/mmtk-core#949 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
Updates to mmtk/mmtk-core#949. --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
Updates to mmtk/mmtk-core#949. --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
Updates to mmtk/mmtk-core#949. --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This PR moves some states from
BasePlan
to a new structGlobalState
. Before this change, the states can only be accessed throughPlan
. Whoever needs to access those states need to acquire or store a reference toPlan
, which is unnecessary. With the changes in the PR,GlobalState
is stored asArc<GlobalState>
. It can be directly accessed through theMMTK
instance, and can also be stored in some components, such as allocators. This change reduces the dependency onPlan
.