-
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
Remove GC in harness_begin. full_heap_system_gc defaults to true #1141
Open
qinsoon
wants to merge
6
commits into
mmtk:master
Choose a base branch
from
qinsoon:remove-gc-from-harness-begin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4243715
Remove GC in harness_begin. full_heap_system_gc defaults to true
qinsoon 9f30403
Add migration guide. Remove unnecessary args in
qinsoon a19a2a4
cargo fmt
qinsoon ab6de72
Fix wrong doc
qinsoon b257517
Introduce exhaustive:bool for handle_user_collection_request. Remove
qinsoon 7c872dd
Update migration guide
qinsoon 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 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 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 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 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -318,12 +318,10 @@ impl<VM: VMBinding> MMTK<VM> { | |||||
self.scheduler.respawn_gc_threads_after_forking(tls); | ||||||
} | ||||||
|
||||||
/// Generic hook to allow benchmarks to be harnessed. MMTk will trigger a GC | ||||||
/// to clear any residual garbage and start collecting statistics for the benchmark. | ||||||
/// Generic hook to allow benchmarks to be harnessed. | ||||||
/// This is usually called by the benchmark harness as its last step before the actual benchmark. | ||||||
pub fn harness_begin(&self, tls: VMMutatorThread) { | ||||||
pub fn harness_begin(&self, _tls: VMMutatorThread) { | ||||||
probe!(mmtk, harness_begin); | ||||||
self.handle_user_collection_request(tls, true, true); | ||||||
self.inside_harness.store(true, Ordering::SeqCst); | ||||||
self.stats.start_all(); | ||||||
self.scheduler.enable_stat(); | ||||||
|
@@ -403,35 +401,26 @@ impl<VM: VMBinding> MMTK<VM> { | |||||
} | ||||||
|
||||||
/// The application code has requested a collection. This is just a GC hint, and | ||||||
/// we may ignore it. | ||||||
/// we may ignore it (See `ignore_system_gc` and `full_heap_system_gc` in [`crate::util::options::Options`]). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We removed
Suggested change
|
||||||
/// | ||||||
/// # Arguments | ||||||
/// * `tls`: The mutator thread that requests the GC | ||||||
/// * `force`: The request cannot be ignored (except for NoGC) | ||||||
/// * `exhaustive`: The requested GC should be exhaustive. This is also a hint. | ||||||
pub fn handle_user_collection_request( | ||||||
&self, | ||||||
tls: VMMutatorThread, | ||||||
force: bool, | ||||||
exhaustive: bool, | ||||||
) { | ||||||
/// * `exhaustive`: The GC should be exhaustive (e.g. full heap GC, compaction GCs, etc.) | ||||||
pub fn handle_user_collection_request(&self, tls: VMMutatorThread, exhaustive: bool) { | ||||||
use crate::vm::Collection; | ||||||
if !self.get_plan().constraints().collects_garbage { | ||||||
warn!("User attempted a collection request, but the plan can not do GC. The request is ignored."); | ||||||
return; | ||||||
} | ||||||
|
||||||
if force || !*self.options.ignore_system_gc && VM::VMCollection::is_collection_enabled() { | ||||||
if !*self.options.ignore_system_gc && VM::VMCollection::is_collection_enabled() { | ||||||
info!("User triggering collection"); | ||||||
if exhaustive { | ||||||
if let Some(gen) = self.get_plan().generational() { | ||||||
gen.force_full_heap_collection(); | ||||||
} | ||||||
} | ||||||
|
||||||
self.state | ||||||
.user_triggered_collection | ||||||
.store(true, Ordering::Relaxed); | ||||||
.store(true, Ordering::SeqCst); | ||||||
self.state | ||||||
.user_triggered_exhaustive_gc | ||||||
.store(exhaustive, Ordering::SeqCst); | ||||||
self.gc_requester.request(); | ||||||
VM::VMCollection::block_for_gc(tls); | ||||||
} | ||||||
|
This file contains 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 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 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 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 we decided that this is going to be an API-breaking change, we can remove this unused
_tls
argument.