-
Notifications
You must be signed in to change notification settings - Fork 77
Make work packet buffer size configurable from one location #1285
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eeefeec
Make work packet buffer size configurable from one location
k-sareen 5a9f203
Address review comments
k-sareen f25e41d
Improve doccomment for the constant
k-sareen 34a6009
Merge branch 'master' into one-location-for-buffer-size
k-sareen 570f755
Address review comments
k-sareen 0fa644e
cargo fmt
k-sareen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is part of the public API, we should be more careful about naming.
This constant is a bit different from others in the
util::constants
module, such as{LOG_,}BYTES_IN_{K,M,G}BYTE
.BUFFER_SIZE
is related to the GC work packet design, and we chose 4096 arbitrarily (and may not be the optimal value). On the contrary, others are mathematical constants.And the name "buffer" alone does not make it clear what kind of buffer it is referring to.
I suggest we add a
pub mod gc_work
and splitBUFFER_SIZE
into two constants:NODES_PACKET_SIZE
: the number of nodes in a ScanObjects packet, andEDGES_PACKET_SIZE
: the number of edges (represented asSlot
now, but may be represented asObjectReference
if we think appropriate for MarkSweep) in aProcessEdgesWork
work packet.We can define both as 4096 so we don't change the semantics, but we may, in the future, make them different.
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 agree with the naming, but I'm not so sure if we want to split the constant into two, at least in this PR.
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 don't know what you mean here. An edge is a slot, no? Regardless of the GC algorithm used.
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.
You can find "Node-ObjRef", "Edge-ObjRef" and "Edge-Slot" in Angus' paper). In that paper, node and edge refer to the queuing strategy, while objref and slot refer to the thing it enqueues. For MarkSweep, since we don't need to update any slot, we can load from the slots immediately while we scan the object, and enqueue the referents directly.
In the current mmtk-core,
Slot
represents a slot, that is, something that holds a reference, and can be updated. But "edge" is more about the queuing strategy. TheProcessEdgesWork
work packet does process edges, in the sense that (1) it provides thetrace_object
method which in theory traces an edge in the object graph and returns how the edge should be updated, and (2) its elements (slots) are created when scanning objects without looking at the child objects. In MarkSweep, we can in theory replaceProcessEdgesBase::slots
with aVec<ObjectReference>
(i.e. the values in the slots). We can also replace it with aVec<(Slot, ObjectReference)>
(slots and their values) which is the "Edge-Tuple" strategy in Angus' paper.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 feel it doesn't matter too much whether we split it into two constants. At least for now, we do not have plans to have different values for edges vs nodes.
The document for the constant should include why we expose this constant to the user, and how users should use this constant.
The constant may be put to the
scheduler
module. We tend to expose constants from their own modules now, rather than putting toutil::constants
.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.
Done